01
代码:
#include <iostream>
using namespace std;
int main() {
cout<<"Hello, World!";
return 0;
}
02
代码:
#include <iostream>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<b;
}
03
代码:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
cout<<setw(8)<<a<<" "<<setw(8)<<b<<" "<<setw(8)<<c;
return 0;
}
04
代码:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
float n;
cin>>n;
cout<<fixed<<setprecision(3)<<n;
return 0;
}
05
代码:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
double n;
cin>>n;
cout<<fixed<<setprecision(12)<<n;
return 0;
}
06
代码:
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
char a;
int b;
float c;
double d;
cin>>a>>b>>c>>d;
cout<<a<<" "<<b<<" ";
cout<<fixed<<setprecision(6)<<c<<" "<<d;
return 0;
}
07
代码:
#include <stdio.h>
#include <iostream>
using namespace std;
int main() {
double n;
cin>>n;
printf("%f\n",n);
printf("%.5f\n",n);
printf("%e\n",n);
printf("%g\n",n);
return 0;
}
08
代码:
#include <iostream>
using namespace std;
int main() {
char a;
cin>>a;
cout<<" "<<a<<endl;
cout<<" "<<a<<a<<a<<endl;
cout<<a<<a<<a<<a<<a;
return 0;
}
09
代码:
#include <iostream>
using namespace std;
int main() {
char a;
cin>>a;
cout<<" "<<a<<endl;
cout<<" "<<a<<a<<a<<endl;
cout<<a<<a<<a<<a<<a<<endl;
cout<<" "<<a<<a<<a<<endl;
cout<<" "<<a;
return 0;
}
题目太基础,就不写解题思路啦~~