大佬帮忙看看 小白快疯了
#include<stdio.h>#include<string.h>
int main()
{
char name[50];
int id[9];
float hight;
printf("Please inter your name.");
gets_s(name);
int i;
for (i = 1; i < 9; i++)
{
printf("Please inter the oder of %d in your id", i);
scanf_s("%f", &id[i]);
}
printf("Please inter your hight in meter.");
scanf_s("%f", &hight);// inter the hight//
int a = strlen(name);
int b;
int c = 0;
char name_rev[50];
for (b = a; b >=0; b--)
{
name_rev[c] = name[b];
c=c++;
}
printf("The reverse name is s%.\n", name_rev); 颠倒部分
getchar();
float d = id[1] + id[2] + id[3] + id[4];
float e = id[5] + id[6] + id[7] + id[8];
float f = d / e;
printf("The addition of first 4 digits is %d.\n", d);
printf("The addition of last 4 digits is %d.\n", e);
printf("The division of them is %f.\n", f);
getchar();
float g = hight*3.02083;
float h = g / 12;
int j = g;
int k = h;
if (g - j < 0.5)
j = j;
else
j = j++;
if (h - k < 0.5)
k = k;
else
k = k++;
printf("Your hight is about %f feet and %f inch.\n", k, j);
getchar();
return 0;
}
颠倒输出的一直是s 算出的数全是整型 什么情况呀