if语句使用--领奖
程序代码:
#include <iostream> using namespace std; int main( ) { char letter; cout <<"请输入你想获奖的字母:" << endl; cin >> letter; if(letter >= 'a') { if( letter <= 'd') { cout << "恭喜你获得大奖" << endl; if(letter == 'c') cout << "你获得了最高奖5000元" << endl; else cout << "你获得了3000元奖金" << endl; } } else cout << "遗憾!" << endl; system("pause"); return 0; }游戏人生!