Search found 2 matches

by yasir.nabil
Thu Jun 23, 2016 7:37 pm
Forum: Volume 111 (11100-11199)
Topic: 11150 - Cola
Replies: 43
Views: 22753

Re: 11150 - Cola

My code passes all the test cases but got WA......why? #include <stdio.h> int func(int allBottle,int remain) { int bottle,add,rem; bottle = (allBottle+remain) / 3; rem = (allBottle+remain) % 3; add = bottle + rem - remain; if((add+2)%3==0&&add!=0&&add>2) return bottle + func(add,2); else if((add + 1...
by yasir.nabil
Thu Jun 16, 2016 11:38 pm
Forum: Volume 115 (11500-11599)
Topic: 11577 - Letter Frequency
Replies: 19
Views: 7176

Re: 11577 - Letter Frequency

#include<stdio.h> #include<string.h> int main() { int T,p,i,j,max,n,ar[26]; char ch[210]; char al[]="abcdefghijklmnopqrstuvwxyz"; scanf("%d",&T); while(T--) { gets(ch); if(ch[0]=='\0') gets(ch); for(i=0;i<26;i++) { ar[i]=0; } al[26]='\0'; n=strlen(ch); for(i=0;i<n;i++) { if(ch[i]>='A'&&ch[i]<='Z') ...

Go to advanced search