1008、
#include <stdio.h>
int main() {
int a, b, c, result;
scanf("%d %d %d", &a, &b, &c);
if (c == 0) {
printf("Error: division by zero\n");
return 1;
}
result = (a + b) / c;
printf("%d\n", result);
return 0;
}
1009、
#include <stdio.h>
int main() {
int dividend, divisor, quotient, remainder;
scanf("%d %d", ÷nd, &divisor);
quotient = dividend / divisor;
remainder = dividend % divisor;
printf("%d %d\n", quotient, remainder);
return 0;
}
1010、
#include <stdio.h>
int main() {
int a, b;
double result;
scanf("%d %d", &a, &b);
if (b == 0) {
printf("Error: division by zero\n");
return 1;
}
result = (double)a / b;
printf("%.9lf\n", result);
return 0;
}
2067、
#include <stdio.h>
#include <math.h>
int main() {
double radius;
scanf("%lf", &radius);
double diameter = 2.0 * radius;
double circumference = 2.0 * M_PI * radius;
double area = M_PI * radius * radius;
printf("%.4lf %.4lf %.4lf\n", diameter, circumference, area);
return 0;
}