C++ 判断

C++ 判断
判断结构要求程序员指定一个或多个要评估或测试的条件,以及条件为真时要执行的语句(必需的)和条件为假时要执行的语句(可选的)。

 1 #include <iostream>
 2 
 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */
 4 using namespace std; 
 5 int main(int argc, char** argv) {
 6     char c;
 7     while((c=getchar())!='
'){
 8         if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
 9         {
10             c=c+4;
11             if(c>'Z'&&c<='Z'+4||c>'z')
12             c=c-26;
13         }
14         cout <<c;
15     }
16     cout <<endl;
17     return 0;
18 }
原文地址:https://www.cnblogs.com/borter/p/9401020.html