题目内容

执行以下程序后,输出结果为。#includeint add(int a,int b);int main(){int a=5,b=6,s=0;s=add(a,b);printf("%d\n",s);return 0;}int add(int a,int b){return a+b;}

查看答案
更多问题

执行以下程序,(1)如果输入25/3,则输出结果为。(2)如果输入35+25,则输出结果为。#includeint add(int a,int b);int sub(int a,int b);int mul(int a,int b);int div(int a,int b);int main(){int a,b,s=0;char op;scanf("%d%c%d",&a,&op,&b);switch(op){case '+':printf("%d",add(a,b));case '-':printf("%d",sub(a,b));case '*':printf("%d",mul(a,b));case '/':printf("%d",div(a,b));}return 0;}int add(int a,int b){return a+b;}int sub(int a,int b){return a-b;}int mul(int a,int b){return a*b;}int div(int a,int b){return a/b;}

执行以下程序,如果输入为23 48 32,则输出结果为。#includeint max(int a,int b,int c);int main(){int a,b,c;scanf("%d%d%d",&a,&b,&c);printf("%d\n",max(a,b,c));return 0;}int max(int a,int b,int c){int max;max=a>b?a:b;if(c>max)max=c;return max;}

执行以下程序,输出结果为。#include#define N 5void display(int a[N]);int main(){int a[N]={1,2,3,4,5};display(a);return 0;}void display(int a[N]){int i;for(i=0;i

执行以下程序,如果第一行输入为5,第二行输入为1 2 3 4 5,则输出结果为。#include#define N 10int sum(int a[],int n);void keyin(int a[],int n);int main(){int a[N];int n;scanf("%d",&n);keyin(a,n);printf("%d\n",sum(a,n));return 0;}void keyin(int a[],int n){int i;for(i=0;i

答案查题题库