| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
测试答案都对,怎么就老是wa呢??/??急死我拉#include "iostream.h"
#include "string.h"
#include "stdio.h"
int main(int argc, char* argv[])
{
char a[27]={"abcdefghijklmnopqrstuvwxyz"},b[27],c[81];
char e[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
int i,len,j;
while(gets(b))
{
gets(c);
len=strlen(c);
for(j=0;j<27;j++)
{
if(c[0]==e[j])
{
printf("%c",b[j]-32);
}
}
for(i=1;i<len;i++)
{
for(j=0;j<27;j++)
{
if(a[j]==c[i])
{
printf("%c",b[j]);
break;
}
else if(c[i]==' ')
{
printf("%c",c[i]);
break;
}
}
}
printf("\n");
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator