我想用If嵌套做一個類似于關(guān)系驗證的程序 但是第一層就出問題了。。。#include using namespace std;main(){
char name='A';
cout<<"請輸入我姓氏大寫首字母\n";
cin>>name;
if(name='A')
cout<<"聯(lián)系人"<<endl;
else
cout<<"陌生人"<<endl; return 0;}然后問題就是無論輸入什么執(zhí)行完都是“聯(lián)系人” 請問錯誤出在哪兒?
- 2 回答
- 0 關(guān)注
- 1279 瀏覽
添加回答
舉報
0/150
提交
取消