}
#include<stdio.h> #include<stdlib.h> void exchange(int *num1, int *num2) { int tmp;tmp = *num1;*num1 = *num2;*num2 = tmp; } int main() { int num1=0;int num2=0;scanf("%d%d", &num1, &num2);printf("num1=%d num2=%d\n", num1, num2);exchange(&num1,&num2);printf("num1=%d num2=%d\n", num1, num2);system("pause");return 0; } #include<stdio.h> #include<stdlib.h> int main() { int num1=0;int num2=0;scanf("%d%d", &num1, &num2);printf("num1=%d num2=%d\n", num1, num2);num1 = num1 + num2;num2 = num1 - num2;num1 = num1 - num2;printf("num1=%d num2=%d\n", num1, num2);system("pause");return 0; } #include<stdio.h> #include<stdlib.h> int max_num(int *p) { int i = 0;for (i = 0; i <9; i++){ if (p[i]>p[i + 1]){ p[i + 1] = p[i];}}return p[9]; } int main() { int arr[10];for (int i = 0; i < 10; i++){ scanf("%d", &arr[i]);}int ret = max_num(arr);printf("%d\n", ret);system("pause");return 0; } #include<stdio.h> #include<stdlib.h> int count_one_bits(unsigned int value) { int count = 0;for (int i = 0; i < 32; i++){ if (value & 1 == 1){ count++;}value = value >> 1;}return count; } int main() { unsigned int value= 0;scanf("%d", &value);int ret = count_one_bits(value);printf("%d\n", ret);system("pause");return 0; }