include <stdio.h> void main(){ int a,b,c,t;scanf ("%d,%d,%d\n",a,b,c);//这里错了应该这样scanf ("%d,%d,%d\n",&a,&b,&c);{if(a>b)t=a;else t=b;} {if (t>c) printf("%d\n",t);else printf("%d\n",c);} } ...
include <stdio.h> include<stdlib.h> main (){ int a,b,c;scanf ("%d,%d,%d",&a,&b,&c);printf("%4d%4d%4d\n",a,b,c);if (b<1||b>12||c<1||c>31)printf("error input\n");else { if (b==1||b==3||b==5||b==7||b==8||b==10|| b==12){ if(b==1...
一:全局变量 include <stdio.h>int a,b,c; //定义三个全局变量void sort() //不需要参数{ int t; if(a>b) { t=a;a=b;b=t; } if(b>c) { t=b;b=c;c=t; } if(a>b) { t=a;a=b;b=t; }}int main(){ printf("输入...
#include<stdio.h> int main() { int max(int x,int y); int a,b,c; scanf("%d%d",&a,&b); c=max(inta,intb);printf("max=%d\n",c);return0;}这段代码有什么错误?... c=max(int a,int b);printf("max=%d\n",c);return 0;}这段代码有什么错误? 展开 我来答 2个回答...
printf("最大值是:%d",c);else printf("最大值是:%d",d);} break;default:break;} } 不知道可否这样?还有一个简洁一点的 include "stdio.h"void main(){ int a,b,c,d,MAX1,MAX;scanf("%d,%d,%d,%d",&a,&b,&c,&d);MAX=(a>b?a:b);MAX1=(MAX>c?MAX:c);switch(MAX1>...
输入的格式需要为12,23然后按回车。是通过“,”来控制的。希望有帮助。
int main() { void swap(int* x,int* y); int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a<b)swap(&a,&b); if(a<c)swap(&a,&c); if(b<c)swap(&b,&c); printf("%d %d %d\n",a,b,c); return 0; } void swap(int* x,int* y) {int t; t=*x; *x=*y; *y=t...
你没有考虑a=0的情况,我把我写的给你看看,你看看有什么不同吧:include<stdio.h> include<math.h> main(){ int a,b,c;double DT,x,x1,x2;scanf("%d %d %d",&a,&b,&c);DT=b*b-4*a*c;if((a==0)&&(b==0))printf("Input error!\n");else { if(a==0){x=-c/(1...
int main(){ int a,b;char ch;printf("请输入x=");scanf("%d",&a);printf("请输入y=");scanf("%d",&b);printf("请输入需要进行的运算:");scanf("%c",&ch);switch(ch)case '+':printf("x+y=%d\n",a+b);break;case '-':printf("x-y=%d\n",a-b);break;case '*':...
void main(){ int x,y,sum;printf(" INPUT X,Y ");scanf("%d",&x);scanf("%d",&y);sum=x*x+y*y;printf("%d*%d+%d*%d=%d",x,x,y,y,sum);getch();}