C程序代码示例,c语言程序举例

1,c语言程序举例加法:int main()
2,c语言程序设计实例#include "stdio.h"void fun(int s[],int *k,int n) int i; *k=s[0]; for(i=1;i<n;i++) if(s[i]<*k) *k=s[i]; } } }void main() int s[5]= int min; fun(s,&min,5); printf("min=%d\n",min);}
3,c语言例子A:Z B:Y C:X作业嘛,我们也做这一题 。其实,有技巧 。不过我至今不清楚“塔”是圆锥还是圆柱体 。首先按圆锥处理的代码: #include #include int main() { double x,y; printf("please input the coordinate (x,y),whthout the brackets.\n"); if(scanf("%lf,%lf",&x,&y)!=2) { printf("error input.\n\n"); system("pause"); return 1; } x=10-10*sqrt((fabs(x)-2)*(fabs(x)-2)+(fabs(y)-2)*(fabs(y)-2)); x<0&&(x=0); printf("the altitude is %g metres.\n\n",x); system("pause"); return 0; } 圆柱体代码: #include #include int main() { double x,y; printf("please input the coordinate (x,y),whthout the brackets.\n"); if(scanf("%lf,%lf",&x,&y)!=2) { printf("error input.\n\n"); system("pause"); return 1; } if((fabs(x)-2)*(fabs(x)-2)+(fabs(y)-2)*(fabs(y)-2)<=1) x=10; else x=0; printf("the altitude is %g metres.\n\n",x); system("pause"); return 0; } 抄作业不好 , 慎 。A:ZB:YC:X【C程序代码示例,c语言程序举例】
4 , C语言简单实例顶楼上!很简单的,自己写,帮你写就是害了你!#include <stdio.h>int main()int stu[10];int i = 9; int change = 1;for( int index = 0; index < 10; ++index )printf("input %dth student score:", index);scanf("%d", &stu[index]);}for (; i>=1&&change; --i)change = 0;for (int j = 0; j<i; ++j)if (stu[j]>stu[j+1])int nTemp = stu[j+1];stu[j+1] = stu[j];stu[j] = nTemp;change = 1;}}} for( int i = 0; i < 10; ++i )printf("%dth student score : %d.\n", i, stu[i]);}return 0;}#include<stdio.h>void main()int a[10], sum;float m;for(int i=0;i<10;i++)scanf("%d", &a[i]);}for(int j=0; j<10; j++)sum = sum+ a[j];}m = (float)sum/10;for(int k=1; k<10; k++)for(int l=0; l<10; l++)int temp;if(a[k]<a[l])temp = a[k];a[k]= a[l];a[l] = temp;}}for(int d=0; d<10; d++)printf("%d", a[d]);}没有调试过,可能会有点问题;但基本是这样!还真有帮你写的 , 还是自己去写吧~

    推荐阅读