题目网站:WZOI
题目:
11.做蛋糕
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,f;
cin>>a>>b>>c>>d>>e>>f;
cout<<a*d+b*e+c*f;
return 0;
}
12.计算 ( a + b ) * c 的值
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b)*c;
return 0;
}
13.求余数
#include<iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
cout<<a%b;
return 0;
}
14.计算 ( a + b ) / c 的值
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
cout<<(a+b)/c;
return 0;
}
15.小玉买文具
#include <iostream>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int c=a*10+b;
int d=19;
int e=c/d;
cout<<e;
return 0;
}
16.买苹果
#include<iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a;
b=a/3*4;
c=a%3;
cout<<b+c;
return 0;
}
17.买牛奶
#include<iostream>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b>>c>>d;
cout<<d/a+d/a*a/b*c;;
return 0;
}
18.小鱼的游泳时间
#include <iostream>
using namespace std;
int main(){
int q1,q2,j1,j2;
cin>>q1>>q2>>j1>>j2;
int qi=q1*60+q2,jie=j1*60+j2;
int time=jie-qi;
int hour=time/60,minute=time%60;
cout<<hour<<" "<<minute;
return 0;
}
19.周长与面积
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
cin>>a>>b;
c=2*(a+b);
d=a*b;
cout<<"perimeter="<<c;
cout<<endl;
cout<<"area="<<d;
return 0;
}
20.求筝形面积
#include <iostream>
using namespace std;
int main(){
long long a,b;
cin>>a>>b;
cout<<a*b;
return 0;
}