AcWing 605. 简单乘积
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin >> a >> b;
printf("PROD = %d",a*b);return 0;
}
AcWing 611. 简单计算
#include<iostream>
using namespace std;
int main()
{
int a1,x1,a2,x2;
double b1,b2;
cin >> a1>> x1>> b1>> a2>> x2>> b2;
printf("VALOR A PAGAR: R$ %.2lf",x1*b1+x2*b2);return 0;
}
AcWing 612. 球的体积
#include<iostream>
#define P 3.14159
using namespace std;int main()
{
int R;
cin >> R;
printf("VOLUME = %.3lf",(4/3.0)*P*R*R*R);return 0;
}
AcWing 613. 面积
#include<iostream>
#define P 3.14159
using namespace std;int main()
{
double a,b,c;
cin >>a >>b >>c;
printf("TRIANGULO: %.3lf\nCIRCULO: %.3lf\nTRAPEZIO: %.3lf\nQUADRADO: %.3lf\nRETANGULO: %.3lf\n",a*c/2,P*c*c,(a+b)*c/2,b*b,a*b);return 0;
}
AcWing 607. 平均数2
#include<iostream>
using namespace std;
int main()
{
double a,b,c;
cin >> a>>b>>c;
printf("MEDIA = %.1lf",(a*2+b*3+c*5)/10);return 0;
}
AcWing 610. 工资和奖金
#include<iostream>
#include<cstring>using namespace std;
int main()
{
string s;
double a,b;
cin >> s ;
cin >> a>> b;printf("TOTAL = R$ %.2lf",(a+b*0.15));
return 0;
}
AcWing 614. 最大值
#include <iostream>
#include <cstring>using namespace std;
int main()
{
int a,b,c;
cin >> a >> b >> c;
int e = max(a,b);
int d = max(e,c);
printf("%d eh o maior",d);return 0;
}
AcWing 617. 距离
#include <iostream>
#include <cstring>using namespace std;
int main()
{
int a;
cin >> a;
printf("%d minutos",a*2);return 0;
}
AcWing 618. 燃料消耗
#include <iostream>
#include <cstring>using namespace std;
int main()
{
long long a,b;
cin >> a >> b;
printf("%.3lf",a*b*1.0/12);return 0;
}
AcWing 656. 钞票和硬币
#include <iostream>
using namespace std;int main()
{
double N;
cin >> N;
int n = (int)N;
int N_sub = 100*N - 100*n;cout << "NOTAS:" <<endl;
cout << n/100 << " nota(s) de R$ 100.00" <<endl;
n %= 100;
cout << n/50 << " nota(s) de R$ 50.00" <<endl;
n %= 50;
cout << n/20 << " nota(s) de R$ 20.00" <<endl;
n %= 20;
cout << n/10 << " nota(s) de R$ 10.00" <<endl;
n %= 10;
cout << n/5 << " nota(s) de R$ 5.00" <<endl;
n %= 5;
cout << n/2 << " nota(s) de R$ 2.00" <<endl;
n %= 2;
cout << "MOEDAS:" <<endl;
cout << n << " moeda(s) de R$ 1.00" <<endl;cout << N_sub/50 << " moeda(s) de R$ 0.50" <<endl;
N_sub %= 50;
cout << N_sub/25 << " moeda(s) de R$ 0.25" <<endl;
N_sub %= 25;
cout << N_sub/10 << " moeda(s) de R$ 0.10" <<endl;
N_sub %= 10;
cout << N_sub/5 << " moeda(s) de R$ 0.05" <<endl;
N_sub %= 5;
cout << N_sub << " moeda(s) de R$ 0.01" <<endl;return 0;
}
AcWing 655. 天数转换
#include<iostream>
using namespace std;
int main()
{
int N,a,b,c;
cin >> N;
a = N / 365;
b =(N - a * 365) / 30;
c = (N - a * 365) % 30;
cout << a <<" ano(s)"<<endl<< b <<" mes(es)"<< endl << c << " dia(s)"<< endl;return 0;
}