码迷,mamicode.com
首页 > 其他好文 > 详细

多项输入

时间:2018-08-02 11:15:55      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:ble   stream   end   OLE   输入输出   cin   his   整型   oop   

 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 }

 

多项输入

标签:ble   stream   end   OLE   输入输出   cin   his   整型   oop   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!