test.c
#include <stdio.h>
extern void printLine();
void say(){
printLine();
printf("I love imooc\n");
printf("good good study!\n");
printf("day day up!\n");
printLine();
}
#include <stdio.h>
extern void printLine();
void say(){
printLine();
printf("I love imooc\n");
printf("good good study!\n");
printf("day day up!\n");
printLine();
}
2022-11-03
hello.c
#include <stdio.h>
extern void say();
void printLine()
{
printf("**************\n");
}
int main()
{
say();
return 0;
}
#include <stdio.h>
extern void say();
void printLine()
{
printf("**************\n");
}
int main()
{
say();
return 0;
}
2022-11-03
#include <stdio.h>
int main()
{
int height = 185;
//补全所有代码
if (height>=180)
{
printf ("%s\n""恭喜小明可以参加校篮球队");
}
return 0;
}
int main()
{
int height = 185;
//补全所有代码
if (height>=180)
{
printf ("%s\n""恭喜小明可以参加校篮球队");
}
return 0;
}
2022-10-21
定义getpeachnumber时要定义一下形参,并且最后输出的时候第一天所剩桃子和所摘桃子数是一致的,但实际上应该再递归一次才能得出第一天所摘桃子数(或者理解为第0天所剩桃子数)
2022-10-18
#include <stdio.h>
int main()
{
double a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = (a + b)* c / d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
int main()
{
double a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = (a + b)* c / d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
2022-10-17
#include <stdio.h>
int main()
{
double a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = (a + b)* c / d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
int main()
{
double a,b,c,d;
double result;
a = 1;
b = 2;
c = 3;
d = 4;
result = (a + b)* c / d; //在这里体验哦~
printf("%f\n", result);
return 0;
}
2022-10-17
#include <stdio.h>
int main()
{
int sum, num;
sum = 0;
for (num = 1; num<= 10; num++) //for循环条件与num的变化值
{
printf(" & quot; % d + % d = " ", sum, num);
sum = sum + num; //计算每次数字之间的和sum
printf(" & quot; % d\n & quot;", sum);
}
printf(" 10以内数的和为: % d; ", sum);
return 0;
}
//这样可以一行行输出
int main()
{
int sum, num;
sum = 0;
for (num = 1; num<= 10; num++) //for循环条件与num的变化值
{
printf(" & quot; % d + % d = " ", sum, num);
sum = sum + num; //计算每次数字之间的和sum
printf(" & quot; % d\n & quot;", sum);
}
printf(" 10以内数的和为: % d; ", sum);
return 0;
}
//这样可以一行行输出
2022-09-27
#include <stdio.h>
int age(int n)
{
if(n==1)
{
return 10;
}
else
{
return age(n-1)+2;
}
}
int main()
{
printf("第5个人的年龄是%d岁", age(5));
return 0;
}
int age(int n)
{
if(n==1)
{
return 10;
}
else
{
return age(n-1)+2;
}
}
int main()
{
printf("第5个人的年龄是%d岁", age(5));
return 0;
}
2022-09-01
#include <stdio.h>
int main()
{
double num = 2.5;
printf("num的整数部分是%.f\n", num);
return 0;
}
int main()
{
double num = 2.5;
printf("num的整数部分是%.f\n", num);
return 0;
}
2022-08-29
int main()
{
int i, j, result;
for (i = 9; i >= 1; i--)
{
for (j = 1; j <= 9; j++)
{
result = i * j;
printf("%d*%d=%d\t ", i, j, result);
if (i == j)
break;
}
printf("\n");
}
return 0;
}
{
int i, j, result;
for (i = 9; i >= 1; i--)
{
for (j = 1; j <= 9; j++)
{
result = i * j;
printf("%d*%d=%d\t ", i, j, result);
if (i == j)
break;
}
printf("\n");
}
return 0;
}
2022-08-25