Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #define N 256
- int main(){
- int n, i, j;
- scanf("%d", &n);
- char a[ 100 ][ N ], aux[ N ];
- for(i = 0; i < n+1; i++){
- fgets(a[ i ], N, stdin);
- }
- /*for(i = 0; i < n+1; i++){
- for(j = 0; j < n+1; j++){
- if(strcmp(a[ i ], a[ j ]) < 0){
- strcpy(aux, a[ i ]);
- strcpy(a[ i ], a[ j ]);
- strcpy(a[ j ], aux);
- }
- }
- }
- printf("\n");
- for(i = 0; i < n+1; i++){
- fputs(a[ i ], stdout);}*/
- /*qsort(a, n+1, N, strcmp);
- for(i = 0; i < n+1; i++){
- fputs(a[ i ], stdout);} */
- for(i = 0; i < n+1; i++){
- ` for(j = 0; j < n+1; j++){
- if(strcmp(a[ strlen(a[i]) - 3 ], a[ strlen(a[j]) - 3 ]) == 0){
- fputs(a[ i ], stdout); printf(" rimeaza cu "); fputs(a[ j ], stdout); printf("\n");
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement