| ||||||||||
| 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 | |||||||||
求牛人帮忙看一下我的程序,到底哪里出问题了#include<iostream.h>
void main()
{
char a[26],b[80];
cin>>a;
cin.ignore();
cin.getline(b,80);
for(int i=0;b[i]!='\0';i++)
{
if(b[i]>='A'&&b[i]<='Z')
cout<<char(a[b[0]-'A']-32);
else if(b[i]>='a'&&b[i]<='z')
cout<<a[b[i]-'a'];
else if(b[i]==32)
cout<<" ";
}
cout<<endl;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator