摘要:
#include<iostream>usingnamespace std;int main(){ char c1,c2,c3,c4; cout<<"Enter your first,middle and last initials"<<endl;//注意提醒用户输入的信息。 cin>>c1>>c2>>c3;//从键盘读取字符。 cout<<"You entered"<<c1<<c2<<c3<<endl; cout<&l 阅读全文
posted @ 2012-06-22 18:14
蚂蚁踩死了大象
阅读(131)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<fstream>usingnamespace std;int main(){ double x; int i,j; ifstream infile1("A.txt"); ifstream infile2("B.txt");//声明从什么文件中读取数据。 infile>>i; infile>>j>>x;//注意:读取、读入文件信息使用的符号不一样。 infile.close(); cout<<"From first fil 阅读全文
posted @ 2012-06-22 17:57
蚂蚁踩死了大象
阅读(118)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<fstream>//使用用于文件输入和输出的fstream头文件。usingnamespace std;int main(){ double income=123.45,expenses=987.65; int week=7,year=2006; ofstream outfile("A.txt");//写入文件。 outfile<<"Week="<<week<<endl;<<"Year=" <<ye 阅读全文
posted @ 2012-06-22 17:32
蚂蚁踩死了大象
阅读(182)
评论(0)
推荐(0)
摘要:
/*从键盘读取数据 1.使用cin对象从键盘输入数据 2.提示输入*/#include<iostream>#include<iomanip>usingnamespace std;int main(){ double income,expense; int month; cout<<"What month is it?"<<endl; cin>>month; cout<<"You have entered the month="<<month<<endl; co 阅读全文
posted @ 2012-06-22 10:49
蚂蚁踩死了大象
阅读(197)
评论(0)
推荐(0)
摘要:
#include<iostream>#include<cmath>//包括数学函数的头文件。#include<iomanip>usingnamespace std;int main(){ double x=3.0,y=4.0; double a,b,c,d,e,f; float g; a=sin(x); b=exp(x); c=log(x); d=sqrt(x); e=pow(x,y); f=sin(y)+exp(x)-log10(y)*sqrt(y)/pow(3.2,4.4); g=log(x);//注意,c和g值相同,但是类型不同... 阅读全文
posted @ 2012-06-22 10:20
蚂蚁踩死了大象
阅读(176)
评论(0)
推荐(0)

浙公网安备 33010602011771号