//本博主所写的代码仅为阅读者提供参考;
//若有不足之处请提出,博主会尽所能修改;
//附上课后编程练习题目;
//若是对您有用的话请点赞或分享提供给它人;
//2.12 - 1.c
#include <stdio.h>
int main(void)
{
printf("Black Clover\n");
printf("Black\nClover\n");
printf("Black ");
printf("Clover\n");
return 0;
}
//-------------
//2.12 - 2.c
#include <stdio.h>
int main(void)
{
printf("My name is Black Clover.\n");
printf("My address is in China.\n");
return 0;
}
//-------------
//2.12 - 3.c
#include <stdio.h>
int main(void)
{
int days;
int age = 18;
int days_per_year = 365;
days = age * days_per_year;
printf("I am %d years old.\n", age);
printf("Days are %d.\n", days);
return 0;
}
//-------------
//2.12 - 4.c
#include <stdio.h>
void jolly(void);
void deny(void);
int main(void)
{
jolly();
jolly();
jolly();
deny();
return 0;
}
void jolly(void)
{
printf("For he's a jolly good fellow!\n");
return;
}
void deny(void)
{
printf("Which nobody can deny!\n");
return;
}
//-------------
//2.12 - 5.c
#include <stdio.h>
void br(void);
void ic(void);
int main(void)
{
br();
printf(", ");
ic();
printf("\n");
ic();
printf(",\n");
br();
return 0;
}
void br(void)
{
printf("Brazil, Russia");
return;
}
void ic(void)
{
printf("India, China");
return;
}
//-------------
//2.12 - 6.c
#include <stdio.h>
int main(void)
{
int toes = 10;
printf("toes = %d\n", toes);
printf("toes * 2 = %d\n", toes * 2);
toes = toes * toes;
printf("toes ^ 2 = %d\n", toes);
return 0;
}
//-------------
//2.12 - 7.c
#include <stdio.h>
void smile(void);
int main(void)
{
smile();
smile();
smile();
printf("\n");
smile();
smile();
printf("\n");
smile();
printf("\n");
return 0;
}
void smile(void)
{
printf("Smile!");
return;
}
//-------------
//2.12 - 8.c
#include <stdio.h>
void one_three(void);
void two(void);
int main(void)
{
printf("Starting now:\n");
one_three();
printf("Done!\n");
return 0;
}
void one_three(void)
{
printf("one\n");
two();
printf("three\n");
return;
}
void two(void)
{
printf("two\n");
return;
}
//-------------
//----------------------------2020年4月2日 -------------------------------