我个纯粹的小白,想通过努力的学习掌握好编程这门技术。
以后就要开始我的狂敲代码之旅了,每天敲4个小时代码。
想通过自己的努力拿到个好offer,于是我就要开始在这里记录我的学习之旅了。
打印100-200之间的素数
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i, j;
for (i = 100; i <= 200; i++)
{
for (j = 2; j <= i - 1; j++)
{
if (i%j == 0)
break;
}
if (j == i)
printf("%d ", i);
}
printf("\n");
system("pause");
return 0;
}
乘法口诀表
#include<stdio.h>
#include<stdlib.h>
int main()
{
int a = 1, b = 1;
for (a = 1; a <= 9; a++)
for (b = 1; b <= a; b++)
{
printf("%d*%d=%-2d ", a, b, a*b);
if (a == b)
printf("\n");
}
system("pause");
}
记录1000-2000年之间的闰年
#include<stdio.h>
#include<stdlib.h>
int main()
{
int x = 1000;
for (x == 1000; x <= 2000; x++)
{
if ((x % 4 == 0 && x % 100 != 0) || (x % 400 == 0))
printf("%d\n", x);
}
system("pause");
return 0;
}