输入3个整数a,b,c编程交换它们的值,即把a的值给b,把b中的值给c,把c中的值给a. 用c语言编程 求解
人气:266 ℃ 时间:2020-06-17 14:23:36
解答
#include "stdio.h"
int main (){
int a, b, c, temp;
printf("请输入三个整数:\n");
scanf("%d%d%d",&a,&b,&c);
printf("输入为%d,%d,%d\n",a,b,c);
temp=a;
a=b;
b=c;
c=temp;
printf("交换后为%d,%d,%d\n",a,b,c);
return 0;
}
推荐
- c语言编程:有3个整数a,b,c,由键盘输入,输出其中最大的数
- .c语言编程输入三个整数a,b.c.求出最大值个最小值
- c语言编程:有3个整数a,b,c,由键盘输入,请输出其中最大的数
- c语言程序设计:设变量a、b、c分别存放从键盘输入的3个整数.编写程序,按从大到小的顺序排列这3个整数.
- 一道C语言题目 有3个整数a,b,c,由键盘输入,输出其中最大的数,请编写程序.
- 沁园春 雪的上阕写了哪些意象?表达了一种什么感情?
- 求大侠帮忙看下语法和中文意思是否正确?We need your help confirm,the bag is the same as last year?
- 亡灵英语怎么拼写
猜你喜欢