
C++第七章
i_3ummer
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
7-4
#include #include using namespace std; void fun1() { int a[10]; ofstream outfile1("f1.data",ios::out),outfile2("f2.data",ios::out); if(!outfile1) { cerr<<"open error!"<<endl; exit(原创 2015-06-16 20:26:19 · 287 阅读 · 0 评论 -
7-2
#include using namespace std; int main() { float a[5]; int i; cout<<"input number:"; for(i=0;i<5;i++) cin>>a[i]; cout.setf(ios::fixed); cout.precision(3); for(i=0;i<5;i++) {原创 2015-06-16 20:18:20 · 264 阅读 · 0 评论 -
7-5
#include #include using namespace std; struct staff { int num; char name[10]; int age; double pay; }; int main() { staff s[7]={1,"z",18,10000,3,"x",18,20000,2,"f",26,20000,4,"m",26,原创 2015-06-16 20:43:26 · 717 阅读 · 0 评论 -
7-6
#include #include using namespace std; //struct staff struct student { int num; char name[10]; //int age; //double pay; double score; }; int main() { student stud[3]={1001,"z",78原创 2015-06-16 20:54:52 · 236 阅读 · 0 评论 -
7-1
#include #include using namespace std; void area(float a,float b,float c) { double s,area; if(a+b<=c) cerr<<"a+b<=c,error!"<<endl; else if(b+c<=a) cerr<<"b+c<=a,error!"<<endl; else原创 2015-06-16 20:11:50 · 288 阅读 · 0 评论 -
7-3
#include #include using namespace std; int main() { for(int i=1;i<8;i++) cout<<setw(20-i)<<setfill(' ')<<" "<<setw(2*i-1)<<setfill('B')<<"B"<<endl; //设置填充字符 return 0; }原创 2015-06-16 20:23:14 · 224 阅读 · 0 评论