首页 > 技术文章 > 我的c++学习(3)字符的输入输出

yangwujun 2013-09-09 11:20 原文

#include "stdafx.h"
#include<iostream>
using namespace std;
int main(void)
{
   /* char c1, c2, c3;
    cin>>c1;
    cin>>c2>>c3;*/


 //char city[11];
 //   cin.getline(city, 10); //由键盘输入城市名
 //   cout << "城市名:" << city << endl;



    int i, j;
    float x, y;
    cout<<"Input i, j, x, y:"<<endl; //D
    cin>>i>>j; //E
    cin>>x>>y; //要求输入十进制数据
    cout<<"i="<<i<<'\t'<<"j="<<j<<endl;
    cout<<"x+y="<<x+y<<endl;

}

 

推荐阅读