首页 > 其他 > 详细

多项输入

时间:2018-08-02 10:41:56      阅读:175      评论:0      收藏:0      [点我收藏+]
 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         //输入输出字符
 7     char c;
 8     cin>>c;
 9     cout<<"c="<<c<<endl;
10 
11     //输入输出整型数据
12     int n;
13     cin>>n;
14     cout<<"n="<<n<<endl;
15 
16     //输入输出浮点型数据
17     double x;
18     cin>>x;
19     cout<<"x="<<x<<endl; 
20 
21     //输入提示
22     cout<<"n=";
23     cin>>n;
24     cout<<"n="<<n<<endl;
25 
26     //多项输入
27     cout<<"c n x"<<endl;
28     cin>>c>>n>>x;
29     cout<<"c="<<c<<" n="<<n<<" x="<<x<<endl;
30     return 0;
31 }

 

多项输入

原文:https://www.cnblogs.com/borter/p/9405636.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!