Search found 2 matches

by nhimran
Mon Jun 22, 2015 12:18 pm
Forum: Volume 4 (400-499)
Topic: 424 - Integer Inquiry
Replies: 96
Views: 39169

Getting WA

I am getting wrong answer with my code. can anyone help me please ?
#include<stdio.h>
#include<string.h>

#define siz 120
int main()
{
char num[102],sum[siz],tmp;
int i,j,ln,res,carry;

memset(sum,0,siz);


while(1){
scanf("%s",num);

if(strcmp(num,"0")==0){
break;
}

ln=strlen(num);

for ...
by nhimran
Wed Feb 11, 2015 6:44 pm
Forum: Volume 109 (10900-10999)
Topic: 10921 - Find the Telephone
Replies: 23
Views: 13373

Re: 10921 - Find the Telephone

Why am I getting WA ? Anyone help plz.



#include<stdio.h>
#include<string.h>

int main()
{
char msg[32];
int len,i;
while(scanf("%s",msg)==1){
len=strlen(msg);
i=0;
while(i<len){
if(msg[i]=='A'){
printf("2");
}
else if(msg[i]=='B'){
printf("2");
}
else if(msg[i]=='C'){
printf("2 ...

Go to advanced search