#include<stdio.h>
int main()
{
int x;
scanf("%d", &x);
int i, j, k;
int n = 0;
i = x / 5;
for (i; i > 0; i--) {
for (j = (x - 5 * i) / 2; j > 0 && 5 * i < x; j--) {
for (k = x - 5 * i - 2 * j; k > 0 && 5 * i + 2 * j < x; k--) {
if (5 * i + 2 * j + k == x) {
n++;
printf("fen5:%d, fen2:%d, fen1:%d, total:%d\n", i, j, k, i + j + k);
}
}
}
}
printf("count = %d", n);
}
&&
#include<stdio.h>
#include<math.h>
int main()
{
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a + b > c && a + c > b && b + c > a) {
double S, C;
double s;
C = (a + b + c) * 1.0;
s = C / 2;
S = sqrt(s * (s - a) * (s - b) * (s - c));
printf("area = %.2lf; perimeter = %.2lf", S, C);
}
else {
printf("These sides do not correspond to a valid triangle");
}
}