用c语言挑选出所输入的奇数
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 11:11:17
#includevoidmain(){inti,n,arr[100],mul=1;printf("请输入n值:");scanf("%d",&n);for(i=0;i
#includevoidmain(){intn;printf("输入一个整数:");scanf("%d",&n);if(n%2==0){printf("%d是偶数\n",n);}else{printf
#includevoidmain(){inta[10],i,sum=0,count=0;printf("请输入10个整数:\n");for(i=0;i再问:奇数输出不了 再答:不好意思,我是
main(){intn;printf("pleaseinputanumber\n");scanf("d%",&n);if(n%2==0)printf("thenumberisoushu");elsep
以3×4的矩阵为例:#includemain(){inta[3][4];inti,j,s;printf("Inputsomenumbers:\n");for(i=0;i
#include#includeintmain(){\x09inti,j,m,n;\x09charch;\x09char*str=NULL;\x09\x09printf("输入位数n:\n");\x0
#includeintmain(){inta;inti;intresult=1;printf("请输入一个奇数\n");scanf("%d",&a);if(a%2==0)printf("这不是奇数\n
#includevoidmain(){charline[30];inti,count1=0,count2=0,count3=0,count4=0;printf("\n请输入一行字符:");gets(l
你的i, j赋上初值为0你求平均不用在循环体里算的, 只需统计i, j的值就行了, 跳出循环的时候算一次就OK了.另外,你求平均,av1,av2就要用float
一楼,二楼的求的是所有偶数的和,不是偶数的平均值!求其中偶数的平均值和奇数的累加和的程序如下:#includeintmain(){inta[6];inti,j=0,sum1=0,sum2=0,aver
#includevoidmain(){charc;intletter=0;printf("请输入一行字符:\n");while((c=getchar())!='\n'){if(c>='a'&&c='A
#includevoidmain(){inta=0;intb;intc=0;do{\x05scanf("%d",&b);\x05if(b!=0)\x05{\x05\x05if(b%2==0)\x05\
#includeintjudge(intnum){returnnum%2==0?0:1;}main(){intn;while(scanf("%d",&n)!=EOF){if(judge(n))prin
#includevoidmain(){inta[10],i=0,j=0;intmax1=0,max2=0,tmp=0;printf("Pleaseinputnumbers:");for(i=0;i再问
#includemain(){inti,n=0,sum=0;inta[10];printf("n\输入10个数:");for(i=0;i
intmain(){inttemp;/*用于临时保存输入的整数*/intsum=0;/*用于求和*/intcount=0;inti;/*输入这10个数*/for(i=0;i{scanf("%d",&t
#include"stdio.h"main(){intx;printf("请输入一个整数");scanf("%d",&x);if(x%2==0)printf("%d是偶数\n",x);elseprin
#include"stdio.h"voidmain(){inti=1,odd=0,even=0;for(;i
//这样就可以了#include<stdio.h>#define N 10int main(){ int&nbs
main(){inta,b,i;do{scanf("%d%d",&a&b);}while(a