第一次给大家做大礼包,1-50题,感谢观看,为了防止丢失,点个赞,加个收藏!关注下我!
10个代码一期
#1
网址:wzoi.cc 上网搜!
不定时更新,需用可以借鉴!
制作不易,点个赞+收藏+关注---三键三连!
答案:
“Hello World!” :
#include <bits/stdc++.h> //包括输入输出流的iostream库
using namespace std; //默认使用std名字空间
int main() //程序执行的入口处,main函数返回整数
{
cout << "Hello World!"; //注意输出流的方向,每条语句以分号结束。
return 0; //程序运行完返回0,表示正常结束,这条语句可省略。
}
打印very good |
#include <iostream>
using namespace std;
int main()
{
cout<<"**************************"<<endl;
cout<<" Very Good!"<<endl;
cout<<"**************************";
return 0;
}
默写数字 |
#include <iostream>
using namespace std;
int main()
{
int a;
cin>>a;
cout<<a<<endl;
return 0;
}
A+B Problem |
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b;
c=a+b;
cout<<c;
return 0;
}
输出第二个整数 |
#include <iostream>
using namespace std;
int main()
{
int a,b,c;
cin>>a>>b>>c;
cout<<b;
return 0;
}
求一个数的前后两个数
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a-b;
cout<<endl;
cout<<a+b;
return 0;
}
竖式计算
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b;
c=a+b;
cout<<setw(10)<<a<<endl;
cout<<setw(4)<<"+";
cout<<setw(6)<<b<<endl;
cout<<"-----------"<<endl;
cout<<setw(10)<<c;
return 0;
}
植树造林
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}
求自行车总价
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a;
b=a*300;
cout<<b;
return 0;
}
正方形边长
#include<bits/stdc++.h>
using namespace std;
int main()
{
int bianchang;
cin>>bianchang;
cout<<bianchang*bianchang;
return 0;
}
第一期 就到这,下面几期看我的个人中心!