请在 下方输入 要搜索的题目:

有以下程序#include<iostream>using namespace std;int main(){ char c;cin>>c;if(c=='y'||c=='Y')int a=1;elseint a=0;cout<<"a="<<a<<endl;}编译错误为:error C2065: 'a' : undeclared identifier,指示语句行cout<<"a="<<a<<endl;变量a没有定义。请分析原因,并做出修改。

有以下程序#includeusing namespace std;int main(){ char c;cin>>c;if(c=='y'||c=='Y')int a=1;elseint a=0;cout<<"a="<

发布时间:2024-07-11 01:05:41
推荐参考答案 ( 由 搜搜题库网 官方老师解答 )
联系客服
答案:
搜搜题找答案
用户信息
没有账号?点我注册
登录 - 搜搜题库网
立即注册
注册 - 搜搜题库网
验证码
立即登录