Files
BasicsOfComputerSoftwareEng…/07/Optional02.c
2022-11-02 19:44:17 +08:00

14 lines
267 B
C

#include <stdio.h>
int main() {
int a, b, n, count=0;
printf("Please input a, b, n: ");
scanf("%d %d %d", &a, &b, &n);
for (;n>0;n--) {
count += a*b;
a--;
b--;
}
printf("The total number is %d", count);
return 0;
}