为什么总是输出错误?小程序我却找不出错误,请教大家
# include <stdio.h>int main()
{
char a,b;
scanf("%c%c",&a,&b);
a=a+1;
b=b+1;
printf("%c %c\n",a,b);
return 0;
} 为什么不管我输什么字符,得到的结果中第二个字符总是!
#include<iostream> using namespace std; int main() { int i; char t1[]= "ABCDEFZZZ$0abcdefzzz*123456^bbbffZZz"; for(i=0;i<strlen(t1);i++) { if (t1[i]=='z') cout<<"a"; else if(t1[i]=='Z') cout<<"A"; else if(t1[i]>='a'&& t1[i]<'z'||t1[i]>='A'&& t1[i]<'Z') { t1[i]++; cout<<t1[i]; } else cout<<t1[i]; } cout<<endl; return 0; }