练习 printf("%d\n", tmp);

#include<stdio.h>
#include<stdlib.h>
int main(){
 int a = 5; int b = 4;
 printf("a=%d,b=%b", a, b);
 int tmp;
 tmp = a;
 a = b;
 b = tmp;
 printf("a=%d,b=%b", a, b);
 

system("pause");
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main(){
 int b[5] = { 1, 2, 3, 4, 5 };
 int a[5] = { 7, 8, 9, 6, 5 };
 int i;
 int tmp;
 for (i = 0; i < 5; i++){
  tmp = b[i];
  b[i]=a[i];
  a[i] = tmp;
 }
 for (i = 0; i < 5; i++){
  tmp = a[i];
  a[i] = b[i];
  b[i] = tmp;
 }
 for (i = 0; i < 5; i++){
  printf("b[i]=%d\n", a[i]);
 }
 putchar("\n");
 for (i = 0; i < 5; i++){
  printf("a[i]=%d\n", b[i]);
 }
 putchar("\n");

system("pause");
return 0;
}
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<stdlib.h>
int main(){
 int tmp, max = 0x80000000;
 int i;
 for (i = 0; i < 10; i++){
  scanf("%d", &tmp);
  if (tmp>max){
   tmp = max;
  }
 printf("%d\n", max);
system("pause");
return 0;
}
posted @ 2019-11-15 17:13  哈哈,呵呵,嘿嘿  阅读(323)  评论(0)    收藏  举报