Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main(int argc, char *argv[]) {
- char wyraz1[20];
- char wyraz2[20];
- puts("podaj slowo");
- gets(wyraz1);
- puts("podaj drugie slowo");
- gets(wyraz2);
- printf("Pierwsze slowo sklada sie z %i znakow\n", strlen(wyraz1));
- printf("Drugie slowo sklada sie z %i znakow\n",strlen(wyraz2));
- if(strcmp(wyraz1,wyraz2)>0) printf("Pierwsze slowo jest dluzsze");
- if(strcmp(wyraz1,wyraz2)<0) printf("Drugie slowo jest dluzsze");
- if(strcmp(wyraz1,wyraz2)==0) printf("Slowa takiej samej dlugosci");
- int b = strcmp(wyraz1,wyraz2);
- printf("\n%i",b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement