Sher-Locked's blog

By Sher-Locked, history, 6 years ago, In English

include<stdio.h>

include<string.h>

int main() { int i,k=0; char str[100]; scanf("%s",str); for(i=1; i<strlen(str); i++) { if(str[i]>=65&&str[i]<=90) { k++; } } if(k==strlen(str)-1) { for(i=0; i<strlen(str); i++) { if(str[i]>=65&&str[i]<=90) str[i]=97+str[i]-65; else if(str[i]>=97&&str[i]<=122) str[i]=65+str[i]-97; } }

printf("%s\n",str);
return 0;

}

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it

By Sher-Locked, history, 6 years ago, In English

include<stdio.h>

int maxDup(int arr[], int size) { int counter = 0, pocket = 1;

int i,j;
for(i=0;i<size;i++)
{
    counter = 0;
    for(j=0;j<size;j++)
    {

        if(arr[i] == arr[j])
            counter++;

    }

    if(counter > pocket)
    {
        pocket = pocket + (counter - pocket);
    }


}


return pocket;

}

int main(void) { int n; int i; int arr[101]; scanf("%d",&n); for(i= 0;i <n;i++) { scanf("%d",&arr[i]); }

printf("%d\n",maxDup(arr, n));

return 0;

}

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it