首页 > 其他 > 详细

自考新教材--p31

时间:2019-12-02 10:22:18      阅读:51      评论:0      收藏:0      [点我收藏+]

源程序:

#include <iostream>

#include <string>

using namespace std;

int main()

{

int oneInt1, oneInt2;

char strArray[20];

string str;

double oneDouble;

char oneChar = ‘a‘;

cout << "输入两个整形值,一个字符,一个字符串和一个浮点值,";

cout << "以空格、Tab键或<Enter>键分隔:"<<endl;

cin >> oneInt1 >> oneInt2 >> oneChar >> strArray >> oneDouble;

str = strArray;

cout << "输入的数据是:" << endl;

cout << "字符串是:\t\t" << str << endl

<< "两个整型值分别是:\t" << oneInt1 << "和\t" << oneInt2 << endl

<< "字符是:\t\t" << oneChar << "\n"

<< "浮点值是:\t\t" << oneDouble << endl;

system("pause");

return 0;

}

 运行结果:

技术分享图片

自考新教材--p31

原文:https://www.cnblogs.com/duanqibo/p/11968797.html

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