Commit 47edbfc6 by viakul

Upload New File

parent 1596515f
Showing with 45 additions and 0 deletions
#include <stdio.h>
#include <string.h>
int main(){
int coincide;
coincide=0;
char names[10][100];
for(int i = 0; i < 10; i++){
printf("Write the name:\n");
scanf("%s", names[i]);
for(int j = 0; j < strlen(names[i]);j++){
if((names[i][j]>64)&&(names[i][j]<91))
names[i][j]+=32;
}
}
printf("\n");
printf("Names in lower case\n");
printf("\n");
for(int i = 0; i < 10; i++){
printf("%s\n", names[i]);
}
printf("Thank you\n");
for(int i=0; i < 10; i++){
for(int j=i+1; j < 10; j++){
if (0==strcmp(names[i], names[j])){
printf("You have the next dublicate: ");
printf("%s\n", names[i]);
coincide = 1;
}
}
}
if (coincide == 0){
printf("Your names do not have a duplicate");
}else{
printf("Your names have a duplicate");
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment