int age = 0;
//第一个人说他10岁
if(n==1)
{
return 10;
}
else
{
age = getAge(n-1) + 2;
}
return age;
//第一个人说他10岁
if(n==1)
{
return 10;
}
else
{
age = getAge(n-1) + 2;
}
return age;
2021-01-05
for(i=9;i>0;i--)
{
for(j=1;j<=i;j++)
{
printf("%d*%d=%d",i,j,i*j);
printf("\t");
}
printf("\n");
}
{
for(j=1;j<=i;j++)
{
printf("%d*%d=%d",i,j,i*j);
printf("\t");
}
printf("\n");
}
2021-01-05
#include <stdio.h>
int main()
{
int age = 15;
int height = 162;
double weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}
int main()
{
int age = 15;
int height = 162;
double weight = 82.5;
char isfat = 'y';
printf("年龄:%d 岁\n", age);
printf("身高:%d CM\n", height);
printf("体重:%f KG\n", weight);
printf("是否属于肥胖儿童:%c\n", isfat);
return 0;
}
2021-01-04
#include <stdio.h>
int main()
{
int number=200;
int year=2014;
do
{
year++;
number *= 1.2; //这里是不是应该写点什么?
}while(number<1000); //这里好像缺点什么
printf("到%d年招工规模突破1000人\n", year);
return 0;
}
int main()
{
int number=200;
int year=2014;
do
{
year++;
number *= 1.2; //这里是不是应该写点什么?
}while(number<1000); //这里好像缺点什么
printf("到%d年招工规模突破1000人\n", year);
return 0;
}
2021-01-03
#include <stdio.h>
int main()
{
// 定义相乘数字i,j以及结果result
int i, j, result;
for (i=9;i>=1;i--) {
for (j=1;j<=i;j++) {
printf("%d*%d=%d ", i, j, result = i*j);
}
printf("%s\n", "");
}
return 0;
}
int main()
{
// 定义相乘数字i,j以及结果result
int i, j, result;
for (i=9;i>=1;i--) {
for (j=1;j<=i;j++) {
printf("%d*%d=%d ", i, j, result = i*j);
}
printf("%s\n", "");
}
return 0;
}
2021-01-03