实验7

11-3

#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
	double values[]={1.23,35.36,653.7,4358.24};
	string names[]={"zoot","jimmy","ai","stan"};
	for(int i=0;i<4;i++)
		cout<<setiosflags(ios_base::left)<<setw(6)<<names[i]<<resetiosflags(ios_base::left)<<setprecision(1)<<setw(10)<<values[i]<<endl;
		return 0;
}

  

11-4

#include<iostream>
#include<iomanip>
#include<string>
using namespace std;
int main()
{
	double values[]={1.23,35.36,653.7,4358.24};
	string name[]={"zoot","jimmy","al","stan"};
	for(int i=0;i<4;i++)
	  cout<<setiosflags(ios_base::left)
	  <<setw(6)<<name[i]<<resetiosflags(ios_base::left)<<setw(10)<<setprecision(1)<<values[i]<<endl;
	return 0;
 } 

  

11-7

#include<iostream>
using namespace std;
int main(){
	char ch;
	while((ch=cin.get())!=EOF)
	 cout.put(ch);
	return 0;
}

  

发生了什么?地球被入侵了???我做错了什么...

 

posted @ 2018-06-20 23:01  枫眠  阅读(155)  评论(0编辑  收藏  举报