wlbk.net
当前位置:首页 >> 求高手帮忙看下这个C语言的题目万分感激可以追加分 >>

求高手帮忙看下这个C语言的题目万分感激可以追加分

BBABBDD(CD)CB++ <=10k=p-1601char ch;scanf("%c",&ch);if(ch>='A'&&ch<='Z'||ch>='a'&&ch<='z') printf("yes!");2int max=0,min=100,n;do{do{ scanf("%d",n);}while(n<=0); if(max<n) max=n; if(min>n) min=n;}while(n);3struct stu{ int number;

#include <stdio.h>int isleapyear(int year){ if((year%4==0&&year%100!=0)||year%400==0) return 1; else return 0;}int main(){ int year=0; int leap=0; printf("please input the year:!\n"); scanf("%d", &year); leap=isleapyear(year); printf("leap is: %d\n", leap); return 0;}

#include <stdio.h> void main() { char i; scanf("%c",&i); if(i>=97&&i<=122) \*小写字母在ASC2码值的范围*\ printf("%c\n",i-32); \*减去32就是小写字母对应的大写字母值*\ else printf("%c\n",i); }林声飘扬也是对的.如果你才学到前几章节,用我的,如果学到在后面一点的,用他的.

1#includeint main(){ int n; scanf("%d",&n); printf("个位数 :%d\n",n%10); printf("十位数 :%d\n",n/10%10); printf("百位数 :%d\n",n/100); return 0;}2#includeint main(){ int m,n; scanf("%d %d",&m,&n); printf("%.2lf %d\n",

#include <stdio.h>int fun(int);void main(){ int n, f; n=1; f=0; do { f=fun(n); n++; //printf("%d\n",f);//如果想要输出全部数列的话加上这一句 } while (f<=800); printf("%d\n",f);} int fun(int m){ if(m==1||m==2)return 1; if(m>2)return fun(m-1)+fun(m-2);}

1.到3.这是有题解吧.4.1 2 3 45.貌似是个完整的.6.include int stu(int a,int b,int c); void main() { int a,b,c; scanf(“%d %d %d”,&a,&b,&c); s=stu(a,b,c); printf("%d",s); } int stu(int a,int b,int c) { int s; s=a*a+b*b+c*c; return s; }7.题干没看明白..

printf("1到5000满足条件的数有:");int prime(int x){int p;for(int i=2;i<x;i++){p=x%i;if(p==0) break;} return p;} /*判断数字是否是素数函数*/for(int i=1;i<5001;i++){int m;if(prime(int i)){do{m=i/10;if(!prime(int m))break;}while(m);if(m==0)printf(",","%d",i);}}

#include "stdio.h"int main(int argc,char *argv[]){ int i,n; double s; printf("Please enter n(int n>0)\nn="); if(scanf("%d",&n)!=1 || n<1){ printf("Input error, exit\n"); return 0; } for(s=1,i=2;i<=n;i++) s += i&1 ? (1.0-i)/i : (i-1.0)/i; printf("The result is %g\n",s); return 0;}运行样例:

#include <stdio.h>int main(){ int i, j, k; int n; int cnt = 0; printf("输入:"); scanf("%d", &n); for(i = 1; i < n/3; ++i) for(j = i+1; j < n/2; ++j) for(k = j+1; k < n; ++k) if(3*i+2*j+k==n && i+j+2*k==100) cnt++; printf("输出:%d\n", cnt); return 0;}

1, @@@@@@@@ 2, s=2 3, s=6 4, AAAAAAAAAAAA 5, 125 6, 8 7, #include <stdio.h>main(){ int i, j; for(i = 1; i<=5; i+=2) { for(j = (5-i)/2; j > 0; j--) printf(" "); for(j = 0; j < i; j++) printf("*"); printf("\n"); }}

相关文档
网站首页 | 网站地图
All rights reserved Powered by www.wlbk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com