标签:des style blog http color io os ar for
题目链接:http://poj.org/problem?id=1298
思路:
水题,字符偏移求解,注意字符串输入问题即可。
代码:
#include <iostream> #include <string> using namespace std; const int MAX_N = 200 + 10; char A[MAX_N]; int main() { int Len; char Tmp[20]; while ( scanf( "%s", Tmp )!= EOF ) { if( strcmp( Tmp, "ENDOFINPUT" ) == 0 ) break; getchar( ); gets( A ); Len = strlen( A ); for ( int i = 0; i < Len; ++i ) { if ( A[i] >= ‘A‘ && A[i] <= ‘Z‘ ) A[i] = (( ( A[i]-‘A‘) - 5 + 26 ) % 26) + ‘A‘; } gets( Tmp ); cout << A << endl; } return 0; }
标签:des style blog http color io os ar for
原文地址:http://www.cnblogs.com/tallisHe/p/4049228.html