openjudge 1.1编程基础之输入输出
Posted darkpurple
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openjudge 1.1编程基础之输入输出相关的知识,希望对你有一定的参考价值。
01:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { 5 cout<<"Hello, World!"<<endl; 6 return 0; 7 }
02:
1 #include<iostream> 2 using namespace std; 3 int main() 4 { int a,b,c; 5 cin>>a>>b>>c; 6 cout<<b<<endl; 7 return 0; 8 }
03:
1 #include<cstdio> 2 #include<iostream> 3 using namespace std; 4 int main(){ 5 int a,b,c; 6 cin>>a>>b>>c; 7 printf("%8d %8d %8d",a,b,c); 8 return 0; 9 }
04:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 float a; 7 cin>>a; 8 printf("%0.3f",a); 9 return 0; 10 }
05:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 double a; 7 cin>>a; 8 printf("%0.12f",a); 9 return 0; 10 }
06:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 double a; 7 cin>>a; 8 cout<<(int)a; 9 return 0; 10 }
07:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 double a; 7 scanf("%lf",&a); 8 printf("%f %0.5f %e %g ",a,a,a,a); 9 return 0; 10 }
08:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 char a; 7 cin>>a; 8 cout<<" "<<" "<<a<<endl; 9 cout<<" "<<a<<a<<a<<endl; 10 cout<<a<<a<<a<<a<<a<<endl; 11 return 0; 12 }
09:
1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 int main() 5 { 6 char a; 7 cin>>a; 8 cout<<" "<<" "<<a<<endl; 9 cout<<" "<<a<<a<<a<<endl; 10 cout<<a<<a<<a<<a<<a<<endl; 11 cout<<" "<<a<<a<<a<<endl; 12 cout<<" "<<" "<<a<<endl; 13 return 0; 14 }
以上是关于openjudge 1.1编程基础之输入输出的主要内容,如果未能解决你的问题,请参考以下文章
noi题库(noi.openjudge.cn) 1.8编程基础之多维数组T1——T10
noi题库(noi.openjudge.cn) 1.8编程基础之多维数组T21——T25
noi题库(noi.openjudge.cn) 1.8编程基础之多维数组T11——T20
noi题库(noi.openjudge.cn) 1.9编程基础之顺序查找T01——T05