gpfd.net
当前位置:首页 >> C语言程序设计编程题题库 >>

C语言程序设计编程题题库

题目1#include "stdio.h" void main(void) { int n=5,m=10,i=1; long sum=1; for(;i<=n;i++) { sum*=i; } printf("\n5! for(i=1;i<=10;i++) { sum*=i; } printf("\n10!=%d",sum); } 题目2#include "stdio.h"#include "string.h" struct Student { char s_

1题#include "stdio.h"main(){ int n,i; float sum=0,t,a=1.0,b=1; printf("please input n:"); scanf("%d",&amp;n); for(i=0;i&lt;n;i++) { t=a/b; sum+=t; b=b+2; } printf("sum=%f\n",sum);}2题#include "stdio.h"#include"math.h"main(){ int n,bai,shi

第一题:#include "stdio.h" void main() { int a,b,sum=0; for(a=0;a main() { char a; int b,c,d,e; b=0;c=0;d=0;e=0; /* b是字母 c是数字 d是符号 e是空格*/ fflush(stdin); printf(

#include <stdio.h>#include <math.h>int main(){ int a, b, c; float d, e, x1, x2; scanf("%d %d %d", &a, &b, &c); d = b * b - 4 * a * c; if (a == 0) printf("不是二元一次方程"); else if (d > 0) { e = sqrt(d); x1 = (-b + e) / (2.0 * a); x2 = (-b - e) / (2.0 * a);

#include<stdio.h>#include<conio.h> voidmain() { printf("***\n"); printf("*****\n"); printf("*******\n"); printf("----------------------\n"); printf("请输入你的账号:\n"); printf("----------------------\n"); printf("请输入你的口令:\n"); printf("----------------------\n"); }

第一种:#include#include#include#includestruct student{ int id; char name[10]; int age; char sex[10]; char birthady[20]; int tel; char nativeplace[50]; }st[50]; int i=0; void shuru() { char a; do{ printf("\n请输入学号:"); scanf("%d",&st[i].id); fflush(

一. 选择题 (共15题, 每题2分,共30分) 1. 定义结构体的关键字是( ) A. union B. enum C.struct D.typedef 2. 设整型变量a为5,使b不为2的表达式是( ) A. b=a/2 B. b=6-(--a) C. b=a%2 D. b=a>3?2:1 3. 下面哪一项是不正确的字符串赋值或

1.试编写一个程序,求[200,950]之间所有能被3整除或能被5整除的数之和.#include <stdio.h>void main(){int i;int sum=0; for(i=200;i<=950;i++) { if(i%3==0||i%5==0) { sum=sum+i; } } printf("%d",sum);}

第一题的:#include<stdio.h> int main() { char c; scanf("%c",&c); if('a'<=c&&c<='z') printf("%c\n",char(c-32)); else if('A'<=c&&c<='Z') printf("%c\n",char(c+32)); else printf("what you input is not a letter! "); return 0; } 第二题的:#include<

bdld.net | so1008.com | dbpj.net | ydzf.net | nwlf.net | 网站首页 | 网站地图
All rights reserved Powered by www.gpfd.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com