有了自己的CSDN博客,希望自己在IT的道路上走得更远



第一次
1.
#include<stdio.h>
#include<math.h>
int main()
{
 int i, j;
 for (i = 100; i <= 200; i++)
 {
  for (j = 2; j <= i - 1; j++)
  {
   if (i%j== 0)
    break;
   else
    printf("%d\n", i);
  }
 }
 return 0;
}
2.
#include<stdio.h>
int main()
{
 int i, j;
 for (i = 1; i <= 9; i++)
 {
  for (j = 1; j <= i; j++)
  {
   printf("%d*%d=%d", i, j, i*j);
  }
  printf("\n");
 }
 return 0;
}
3
#include<stdio.h>
int main()
{
 int year;
 for (year = 1000; year <= 2000; year++)
 {
  if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)
   printf("%d", year);
 }
 return 0;
}
第二次
1.
#include<stdio.h>
//#include <stdlib.h>
int main()
{
 int a = 3, b = 7;
 a = a^b;
 b = b^a;
 a = a^b;
 printf("a=%d b=%d\n", a, b);
 system("pause");
 return 0;

}
2.
#include<stdio.h>
#include <stdlib.h>
int main()
{
 int i ;
 int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
 int max = a[0];
 for (i = 0; i <= 9; i++)
 {
  if (a[i] > max)
   max = a[i];
 }
 printf("max=%d\n", max);
 system("pause");
 return 0;
}
第三次
1.#include<stdio.h>
#include<stdlib.h>
int main()
{
 int A[3] = { 1, 2, 3 }, B[3] = { 2, 4, 6 },C[3];
 int i;
 for (i = 0; i < 3; i++)
 {
  C[i] = A[i];
  A[i] = B[i];
  B[i] = C[i];
 }
 for (i = 0; i < 3; i++)
  printf("%d", A[i]);
 printf("\n");
 for (i = 0; i < 3; i++)
  printf("%d", B[i]);
 system("pause");
 return 0;
 
}
2.
3.
#include<stdio.h>
#include<stdlib.h>
#include <conio.h>
int main()
{
 int x, y, z, t;
 scanf("%d%d%d", &x, &y, &z);
 if (z > x)
 {
  t = x; x = z; z = t;
 }
 if (y > x)
 {
  t = x; x = y; y = t;
 }
 if (z > y)
 {
  t = y; y = z; z = t;
 }
 printf("%d%d%d", x, y, z);
 system("pause");
 return 0;

}
4.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值