#include
#include
#include
int min(int a, int b) {
return a < b ? a : b;
}
int main() {
int shirts, pants, suits, ans;
scanf("%d%d", &shirts, &pants);
suits = min(shirts, pants);
ans = suits >= 50 ? (suits * 80) : (suits * 90)
+ (shirts - suits) * 60
+ (pants - suits) * 45;
printf("应付金额: %d\n", ans);
}
#include
#include
#include
int main() {
int a, b, c, d;
scanf("%d%d", &a, &b);
c = a * b;
while (b != 0) {
d = a % b;
a = b;
b = d;
}
printf("最大公约数: %d\n最小公倍数: %d\n", a, c / a);
}
1,
#include
int main(){
int i = 0;j = 0;
int kuzi = 0,guazi = 0,jia = 0;
scanf("%d %d",&kuzi,&guazi);
i = kuzi>guazi?guazi:kuzi;
jia = (i >= 50?80:90) * i+ (kuzi-i)*45+(guazi - i)* 60;
printf("%d",jia);
return 0;
}
2,
#include
int main(){
int i = 0;
int a = 0,b = 0;
int bei = 0,yue = 0;
scanf("%d %d",&a,&b);
for(i = 2;i < a;i ++)
if(a%i == 0&& b % i == 0)
yue = i;
bei = a*b / yue;
printf("最大公约数是%d 最小公倍数是%d",yue,bei);
return 0;
}