发布网友 发布时间:2024-09-29 04:05
共0个回答
五、编程题 1. 编程实现:从键盘上接收10个整数,并对其进行排序(要求排成升序)main(){int a[10],i,j,k,t;for(i=0;i<10;i++) scanf("%d",&a[i]);for(i=0;i<9;i++){k=i;for(j=i+1;j<10;j++)if(a[j]<a[k]) k=j;if(k!=i){t=a[k];a[k]=a[i]; a...
C语言,编程题的1和3 下课就要交,急急急!第一题的 include<stdio.h> include<stdlib.h> include<math.h> bool is_su(int i){ if(i==2||i==3)return true;for(int a = 2;a<=i/2;a++){ if(i%a==0)return false;} return true;} int main(){ int sum = 0;for(int i = 500,j=0;i>0,j<20;i--){ if(is_...
急求用c语言编程写出这十题1,include<stdio.h>void main(){ printf("我的名字是张三.\n"); printf("我是一个男性。\n"); printf("我今年24岁了。\n"); printf("我在三年二班。\n"); }2,include<stdio.h>void main(){ int m; m=923; printf("m=%d.\n",m); }3,include<stdio.h>void main(){ flo...
急!急!简单c语言编程题,求编写代码//第一题#include<stdio.h>void fun(int n){ int i,j,k,t;for(k=0;k<n;k++)//控制总行数{ for(i=0;i<n-k-1;i++)//控制输出空格,因为空格不好看见,就用*代替 printf("%c",'*'); for(j=0;j<2*k+1;j++)//控制输出字母 { printf("%c",65+j)...
c语言编程题,用for循环!急急急include<stdio.h>int main(){int hg,bhg;for(hg=1;hg<2000;hg++)for(bhg=0;bhg<2000;bhg++)if(hg*5-bhg*18==9931){printf("%d",hg);}return 0;}
c语言编程题,请高手帮忙做一下,拜谢,急急急急……1.include <stdio.h> double funcPi(int);int main(void){ int arg;printf("Input the argument: ");// // 无异常输入 // while (!scanf("%d", &arg)){ printf("Check your input and retry: ");while (getchar()!='\n'){ continue;} } while (getchar()!='\n'){ continue...
C语言的编程问题,求高手解答啊。新手很不明白。6月19号之前需要用到...int a[N][N],b[N][N],c[N][N],n=4;void main(){ int i,j;printf("请输入矩阵维数2-10:\n");scanf("%d",&n);printf("请输入矩阵A:\n");for(i=0;i<n;i++){ printf("第%d行数据:\n",i+1);for(j=0;j<n;j++)scanf("%d",&a[i][j]);} printf("请输入矩阵...
c语言编程题,编写一个函数,实现n阶方阵的转置(即行列互换)急急急...include <stdlib.h> int main(){ int a[3][3]={1,2,3,4,5,6,7,8,9};int j,i,temp;for(i=0;i<3;i++)for(j=0;j<3;j++)scanf("%d",&a[i][j]);for(i=1;i<2;i++)for(j=0;j<=i;j++){ temp=a[i][j];a[i][j]=a[j][i];a[j][i]=temp;} for...
C语言紧急编程~!void main(){ int n,m;int x,y;int a[11][11];int i,j;int p,q;while(scanf("%d%d",&n,&m)!=EOF){ if(n==0&&m==0) break;a[0][1]=0;p=1;q=1;// p是行,q是列 x=n;y=m;while(1){ for(i=p;i<=n;i++) a[i][p]=a[i-1][p]+1;q++;for(j=q;...
C语言编程题,急,请大家帮忙啊,不会的也试试啊,急1.include"stdio.h"defineL100 defineU200 defineFACTOR5 voidmain(){inti;printf("%5d之间%5d不能被%5d蒸出的数如下:\n",L,U,FACTOR);for(i=L;i<=U;i++)if(i%FACTOR)printf("%-4d",i);} 2.include"stdio.h"voidmain(){ intx[12]={2,45,67,12,3,9,76,45,23,42,6,5}...