单片机C语言作业及上机习题仅供参考_第1页
单片机C语言作业及上机习题仅供参考_第2页
单片机C语言作业及上机习题仅供参考_第3页
单片机C语言作业及上机习题仅供参考_第4页
单片机C语言作业及上机习题仅供参考_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、第一次课熟悉winTC编译环境、熟悉C语言程序结构1.使用C 语言编译环境,输入下面的源程序。将你的程序命名为hello.c,然后编译运行它。/* program writes the words "Hello, world" to the screen*File : Hello.c* By : NJCIT* Date : 07-03-09*/#include <stdio.h>main()printf("Hello, worldn");return(0);2.main() /*求两数之和*/ int a,b,sum; /* 这是变量定义*/

2、 a=123;b=456; sum=a+b; printf(“sum is %dn”,sum); 问题:1. 一个C语言源程序从哪里开始执行?2.C程序的函数由几部分构成?3. ANSI C 中的注释内容是用什么符号界定?第二次课熟悉printf()函数、常见转义字符及各种数据类型的输出格式1.#include <stdio.h>main()printf("nnnn a few new lines ");printf("nttand nsome ntabs");printf("nand a beep just to be heard

3、.an");printf("nthi");printf("s wor");printf("ks toon");return (0);(1) printf()函数的功能是什么?(2) 在 printf()函数中n的起什么作用?(3) 在 printf()函数中t的起什么作用?(4) 在 printf()函数中a的起什么作用?2. main() int a=5,b=7,c=-1; float x=67.8564,y=-789.124; char c=A; long n=1234567; unsigned u=65535; pri

4、ntf(“%d%dn”,a,b); printf(“%3d%3dn”,a,b); printf(“%f,%fn”,x,y); printf(“%-10f%-10fn”,x,y); printf(“%8.2f,%8.2f,%.4f,%.4f,%3f,%3fn”,x,y,x,y,x,y); printf(“%e,%10.2en”,x,y); printf(“%c,%d,%o,%xn”,c,c,c,c); printf(“%ld,%lo,%xn”,n,n,n); printf(“%u,%o,%x,%dn”,u,u,u,u); printf(“%s,%5.3sn”,”COMPUTER”,”COMPUT

5、ER”);3. 假设下面的例子都是完整程序的一部分,那么他们每一个将会输出什么?a. printf("Baa Baa Black Sheep.");b. printf("Have you any wool?n");c. printf("Begone!nO creature of lard!");d. printf("What?nNolnBonzo?n");e. int num;num = 2;f. printf("%d + %d = %d", num, num, num + num);4.加载,

6、编译并运行下面的程序。显示输出界面然后回答下面的问题。#include <stdio.h>main()char ch;int x;float y;double z;ch = A;printf("ch = %c and its ascii value is %d. What is ASCII I wonder?n",ch, ch);x = 10;printf("x = %dn", x);y = 3.1415926;printf("y = %fn", y);z = 4.75E5;printf("z = %lfn&qu

7、ot;, z);return(0);1. 字符的A的ASCII码是多少?2. “%f”默认情况下小数点后面有几位数字?3. 程序中的字符被指定的值为A,为什么不是“A”?4. 改变程序使它以10个字符位宽度和2位小数的形式输出浮点型数据。5. 改变程序使它以6个字符位宽度输出整型数,左对齐。3.问答题(1)C语言的基本数据类型有几种,分别是什么,并指出各种数据类型的关键字?(2)描述C语言中标识符的组成(3)常量和变量的区别是什么?(4)在程序中如何使用变量?(5)从下面列出标识符中选出哪些可以用作合法的C用户定义标识符,哪些不能使用。为什么?(1) a3_b3 (2)void (3) _12

8、3 (4)123_ (5) IF (6) INT (7) For (8) printf (9) WORD (10) define (11) _abc (12) sizeof (13) answer (14) to (15)signed (16) Case (17)_if (18) extern (19) putchar (20) _double(6)请选出正确的数值和字符常量,说明类型;对于不正确的数,说明原因(1) 0.0 (2) 5L (3) o13 (4) 0Xff (5) oxaa (6) 018 (7) 9861 (8) 011 (9) 3.987E-2 (10) .987 (11)

9、 0xab (12) 50. (13) 8.9e1.2 (14) 1e1 (15)0xFF00 (16) 0.825e2 (17)473 (18) OX4 (19) “c” (20)t(21) ” (22)0 (23)0 (24) A4选择题(1)合法的字符常量是 。A) t B) “A” C) a D)x32(2) 合法的字符常量是 。A) 084 B) 84 C) ab D)x43(3)是C语言提供的合法的数据类型关键字。A) Float B) signed C) integer D)Char(4)在以下各组标识符中,合法的标识符是。A) A)B01 B)table_1 C) 0_t D)

10、 k%B) A)Fast_ B) void C)pbl D)<book>C) A)xy_ B)longdouble C)*p D)CHARD) A) sj B)Int C)_xy D)w_y23(5)属于合法的C语言长整型常量的是 。A)5876273 B)0L C)2E10 D)(long)5876273(6)下面选项中,不是合法整型常量的是A)160 B)0xcdgC)01 D)0x48a第三次课熟悉scanf()函数的使用:1. 用下面的scanf()函数输入数据,使a=3,b=7,x=8.5,y=71.82,c1=A,c2=a;main() int a,b; float x

11、,y; char c1,c2; scanf(“a=%d b=%d”,&a,&b); scanf(“ x=%f y=%e”,&x,&y); scanf(“ c1=%c c2=%c”,&c1,&c2);printf(“a=%d b=%d”,a,b); printf(“ x=%f y=%e”,x,y); printf(“ c1=%c c2=%c”,c1,c2);2.加载,编译并运行下面的程序然后回答下面的问题。#include <stdio.h>main()int user_age;char user_name51;/* Get the u

12、sers name */printf("Enter your name :");scanf("%s", user_name);/* Get the users age */printf("Enter your age in years :");scanf("%d", &user_age);/* Print out their name and age in days */printf("Gday %s, you are %d days oldn", user_name, user_age

13、*365);return(0);1. 存储用户名的变量名是什么?2. 改写这个程序使他可以用一个单独的变量以天的形式存储用户的年龄。3.使用scanf() 读取多行输入#include <stdio.h>main()int user_age;char user_name51;/* Get the users name and age*/printf("Enter your name followed by your age in years (eg fred 23) :");scanf("%s %d", user_name, &use

14、r_age);/* Print out their name and age in days */printf("Gday %s, you are %d days oldn", user_name, user_age*365);return(0);1. 当你在回答问题时颠倒了年龄和姓名会出现什么情况?2. 当你在代码中省去了&时会出现什么情况?4编程题(1) 已知a,b均是整型变量,写出将a,b两个变量中的值互换的程序来。(2)若a=3,b=4,c=5,x=1.2,y=2.4,z=-3.6,u=51274,n=128765,c1=a,c2=b。想得到以下的输出格式和

15、结果,请写出程序(包括定义变量类型和设计输出)。  a= 3 b= 4 c= 5  x=1.200000,y=2.400000,z=-3.600000  x+y= 3.60 y+z=-1.20 z+x=-2.40  u= 51274 n= 128765  c1=a or 97(ASCII)  c2=b or 98(ASCII)(3)输入一个华氏温度,要求输出摄氏温度,公式为:,取两位小数。5.请判断以下表达式是否正确,若正确,写出表达式的值;若不正确,写出出错原因。各变量的类

16、型说明如下:int i=8, j=3, k, a, b;unsigned long w=5, u;double x=1.42 , y=5.2 , t ;(1) k=i+ (2) (int)x+0.4 (3) w+=-2 (4) y+=x+ (5) i/=j+12(6) k=-i (7) f=3/2*(t=30.0-10.0) (8) k=(a=2,b=3,a+b)(9) a+=a-=(b=4)*(a=3) (10) a=2*a=3(11) u=65535, j=-1,u=u+j (12) +(i+j) (13) 2%(-3) (14) -2%(-3)6. 求以下表达式的值,假设所有变量都为整型

17、。(1) (a=b=4,a+1,b+1,a+b)(2) (a=2,b=5,a>b?a+:b+,a+b)(3) (x=8,x%=x+5)(4) 30 % 6 / 27.写出下面各逻辑表达式的值。设:a=3,b=4,c=5.(1)a+b>c&&b=c(2)a |b+c&&b-c(3)!(a>b) && !c | 1 (4)!(x=a)&&(y=b)&&0(5)!(a+b) + c 1 && b + c/2 第四次课1. if语句应用(1)加载,编译并运行下面的程序,先使用一个正整数,然

18、后再使用一个负数。有什么不同?#include <stdio.h>main()int x;printf("Enter a number between -10 and +10 : ");scanf("%d", &x);if (x > 0) printf("nYour number is positiven");return(0);(2)使用if语句避免除0#include <stdio.h>main()float x, y;printf("Enter a number to be inv

19、erted : ");scanf("%f", &x);y = 1/x;printf("The inverse of %f equals %fn", x, y);return(0);1. 当你输入数字0时结果为多少?2. 增加一个if语句使它只有当if x不等于0时进行计算。3. 现在你输入0会出现什么情况?4. 改进程序使之可以当输入数字0时打印出警告信息。(3)编写if语句写一个程序用来计算电阻上的功率。功率大小等于电阻上的电压值乘以流过电阻的电流值。完成计算后,使用一个if 语句判断功率是否低于0.5 瓦特。如果低于0.5 瓦特则输

20、出“Okey to use half watt resistor”,否则输出“haff watt registor willnot be okey”。下面是程序的开始部分,请添加完成if语句。#include <stdio.h>main()float power, voltage, current;printf("Enter the voltage : ");scanf("%f", &voltage);printf("Enter the current : ");scanf("%f, &curre

21、nt);/* Calculation here */* if check here */* else here */return(0);如果功率小于0.5 瓦特,屏幕输出应该如下所示:Enter the voltage : 5Enter the current : 0.002okay to use half watt resistor.如果功率大于0.5瓦特:Enter the voltage : 5Enter the current : 200half watt resisitor will not be okay.2. 编程练习:(1) 有三个整数a,b,c,由键盘输入,输出其中最大的数。

22、#include<stdio.h> main() int a,b,c,max; scanf("%d,%d,%d",&a,&b,&c); if (a>b) if (a>c) max=a; else max=c; else if (c<b) max=b; else max=c; printf("max=%d",max); (2) 编程输入整数a和b,若 大于100,则输出 百位以上的数字,否则输出两数之和。(3) 有一函数:写一个程序,输入x的值,输出y值。(4)写一段程序计算两个并联电阻的阻值,使你的程

23、序检查是有短路的(0欧姆)将导致0作为被除数,使用一个if语句或者三目运算避免这种情况(使用三目运算计算及检查是否除0)。提示: Rt = 1 / (1/R1 + 1/R2);你的输出应该如下所示:Enter the value of resistor 1 : 45Enter the value of resistor 2 : 5645.0 ohms in parallel with 56.0 ohms gives 24.95 ohms假如有一个电阻阻值为0的话,结果将如下所示:Enter the value of resistor 1 : 0Enter the value of resist

24、or 2 : 450.0 ohms in parallel with 45.0 ohms gives 0.00 ohms第5次课1. switch语句应用(1)加载,编译并运行下面的程序,并回答问题。#include <stdio.h>main()int num1, num2, ans;char arithOp;ans=0;printf("Enter number 1 -> ");scanf("%d", &num1);printf("Enter number 2 -> ");scanf("%d

25、", &num2);printf("Enter an operator (+, - or *) -> ");fflush(stdin);scanf("%c", &arithOp);switch (arithOp) case +:ans = num1 + num2; break;case -:ans = num1 - num2; break;case *:ans = num1 * num2; break;printf("n%d %c %d = %d", num1, arithOp, num2, ans);

26、fflush(stdin);getchar();return(0);1. 尝试输入一个不匹配case语句的操作符,会发生什么?2. 将程序保存为switch-02.c并为“ans”添加乘(*)和除(/)的算法。3. 添加一个default语句来处理输入的运算符不符合case情况。4. 添加程序处理除数为零的情况。2. 加载,编译并运行下面的程序,将文件保存为switch-01.c(2)加载,编译并运行下面的程序。#include <stdio.h>main()int choice;printf("How many stars (1 to 10) do you want?

27、");scanf("%d", &choice);switch (choice) case 10:printf("*");case 9:printf("*");break;case 8:printf("*");case 7:printf("*");case 6:printf("*");case 5:printf("*");break;case 4:printf("*");case 3:printf("*&quo

28、t;);case 2:printf("*");case 1:printf("*");break;default:printf("The number you asked for is out of rangen");return(0);1. 打印 9颗星和8颗星是不同的。描述这两种方法。2. 编辑这段程序,使之工作在没有break语句的情况下。(3)任务1:完成下面的程序,使用if/else语句,判断输入的数是正数还是负数任务2:完成下面的程序,使用switch语句,判断输入的数是正数还是负数,并且要处理输入的数越界的情况。#incl

29、ude <stdio.h>main()int num;printf("Program indicates whether number is +ve or -ven");printf("Enter a number between -5 and +5 :");scanf("%d", &num);/* 添加语句 */return(0);(4)本程序是从键盘输入一个10进制数,根据用户要求输出这个数对应的16进制、8进制或者10进制数。例:若用户输入“H”,则输出这个数的16进制数。任务1:添加if语句完成程序功能任务

30、2:添加switch语句完成程序功能,注意对输入无效数制的处理。比如输入:X时,作何处理。#include <stdio.h>main()int num;char choice;printf("Program prints octal or hex equivalent of numbersenteredn");printf("Enter an integer : ");scanf("%d", &num);printf("Do you want Decimal, Octal or Hex (H, D, O

31、) : ");fflush(stdin);choice = getchar();/* 添加程序 */return(0);(5) 给出一百分制成绩,要求输出成绩等级A,B,C,D,E。90分以上为A,8089分为B,7079分为C,6069分为D,60分以下为E。(6) 从键盘输入三个数,判断这三个数是否能构成三角形,如果是,输出“the three numbers could be the sides of a triangle”,如果不是输出“the three numbers couldt the sides of a triangle”;并判断这个三角形是不是直角三角形,如果是

32、,输出“the numbers could be the sides of a right angletriangle”,如果不是,输出“the numbers couldt the sides of a right angletriangle”。第6次课 循环1. 写一个程序让用户输入一个112之间的数,程序将会输出这个数的乘法表。使用一个循环进行计算并输出一行,屏幕输出应该如下所示:Enter a number between 1 and 12: 55 times multiplication table1 x 5 = 52 x 5 = 103 x 5 = 154 x 5 = 205 x

33、5 = 256 x 5 = 307 x 5 = 358 x 5 = 409 x 5 = 4510 x 5 = 5011 x 5 = 5512 x 5 = 602. 添加循环语句,计算并输出120之间的偶数的和。#include <stdio.h> main()int i, result;/* 添加语句 */return(0);#include <stdio.h>main()int i, result; for (i=1;i<=20;i+) if (i%2=0) printf("%dt",i); getch();return(0);3. Brea

34、k 语句的使用为程序添加语句,使得输入的数据在110之间时,退出循环,否则输出“the number is out of range”#include <stdio.h>main()int num;while (1) printf("Enter a number between 1 and 10 :");scanf("%d", &num);/* if ( <- Complete here) */printf("Your number was %dn", num);return(0);4. 任务1:添加程序,使

35、得其在从注释A开始到注释C之间循环,并提示用户输入“0”退出循环;#include <stdio.h>main()int i, num;char isPrime;printf("Program checks to see if a number is primen" );printf("Enter the integer : "); /* A */scanf("%d", &num);isPrime = 1; /* B */for (i = num - 1; i > 1; i-) if (num % i = 0

36、) isPrime = 0;printf("Number %d is divisible by %d and is not primen", num,i);break;if (isPrime)printf("Number %d is PRIMEn", num); /* C */return(0);任务2:添加程序,使得注释B到注释C之间的语句在一个循环之内,从而判断从num开始到1之间所有的素数。#include <stdio.h>main()int i, num;char isPrime;printf("Program check

37、s to see if a number is primen" );printf("Enter the integer : "); /* A */scanf("%d", &num);while (1)isPrime = 1; /* B */for (i = num - 1; i > 1; i-) if (num % i = 0) isPrime = 0;printf("Number %d is divisible by %d and is not primen", num,i);break; if (isPri

38、me)printf("Number %d is PRIMEn", num); /* C */num-=1;if (num=0)break;getch();return(0);5.求爱因斯坦数学题。有一条长阶,若每步跨2阶,则最后剩余1阶;若每步跨3阶,则最后剩2阶;若每步跨5阶,则最后剩4阶;若每步跨6阶,则最后剩5阶;若每步跨7步,最后正好一阶不剩。6.计算斐波那契分数序列前n项之和(n是某个常数).( 2/1,3/2,5/3,8/5,13/8,21/13,. 前一项的分子作为后一项的分母。前一项的分子、分母之和作为后一项的分子。)。7.问答题(1)下面循环错在哪里?fo

39、r (i = 1; i > 5; i+) x /=2;(2)下面循环错在哪里?for (i = 10; i > 2; i+) x *=2;(3)这个for循环的输出结果是多少?for (i = 3; i > -2; i-) printf("%d ", i);(4)这个while循环的输出结果是多少?i = 0;while (i < 5) i+;printf("%d ", i * i);(5)while循环错在哪里?i = 0;while (i = 10) i+;x *= 2;(6)完成下面的代码使之可以输出你的名字28次.for

40、(i = 3; i > i-) printf("My name is");综合练习一:打印ASC码表在这个项目中,我们想去打印所有的ASCII码字符及相关联的十进制和二进制值。关于ASCIIASCII表示美国信息交换标准码,正如它的名字所暗示的, 它是由美国的一个代码指定的数字每个信息存储或传输计算机来完成。这里是关于ASCII码的重点:l 每个键盘字符都可以映射到数字从32127;l 数字从0 到31用于特殊字符,如制表符、铃、换行符等;l 扩展ASCII范围从128 至255,含有专门128 个字符,如边框线等;l 扩展的ASCII字符是非标准化,可能会从一个操作

41、系统类型到另一个(如PC和MAC与Linux);l 标准的ASCII是标准化的,同样都可以跨越不同的操作系统类型。第一步写出程序的基本框架任何C程序都具有以下的基本框架/* Title : Print Standard and Extended ASCII chart* Source : print_ascii.c* Author : Some Student* Version : 1.0*/#include <stdio.h>main()第二步添加一个具有一个变量的循环语句我们想去打印所有的标准和扩展ASCII码的值,这就意味着循环从0至255/* Title : Print S

42、tandard and Extended ASCII chart* Source : print_ascii.c* Author : NJCIT* Version : 1.0*/#include <stdio.h>main()int i;for (i=1; i<=255; i+) return(0);第三步不同数据格式打印变量值我们现在想使用十进制和十六进制和ASCII字符打印每个字符。/* Title : Print Standard and Extended ASCII chart* Source : print_ascii.c* Author : NJCIT* Vers

43、ion : 1.0 - Initial release*/#include <stdio.h>main()int i;for (i=1; i<=255; i+) printf("%d %x %cn", i, i, i);return(0);第四步打印标题并将每列对齐现在,我们将每一个字符打印出来,使它变得整洁些并给每一栏加一个标题,注意如何选择适当的宽度打印每一栏。我们也会修改一些在我们试图打印一些如“n/a”的控制符代替一些ASCLL码字符(这些字符是一些不可打印的字符)出现的问题。/* Title : Print Standard and Extend

44、ed ASCII chart* Source : print_ascii.c* Author : NJCIT* Version : 1.1*/#include <stdio.h>main()int i;printf("DEC HEX ASCIIn");for (i=1; i<=255; i+) if (i < 32)printf("%3d %3x %5sn", i, i, "n/a");elseprintf("%3d %3x %5cn", i, i, i);return(0);第五步使它更适

45、应屏幕现在你可能注意到,没有太多的屏幕是被用来横跨宽.不仅如此, 你必须退回通过输出缓冲区以便看到更低的数字. 这样效率更高, 如何255行被分割成5栏52行的话就更容易阅读。/* Title : Print Standard and Extended ASCII chart* Source : print_ascii.c* Author : NJCIT* Version : 2.0*/#include <stdio.h>main()int i;printf("| DEC HEX ASC | DEC HEX ASC | DEC HEX ASC ");printf

46、("| DEC HEX ASC | DEC HEX ASC |n");for (i=1; i<=51; i+) if (i < 32)printf("| %3d %3x %3s ", i, i, "n/a");elseprintf("| %3d %3x %3c ", i, i, i);printf("| %3d %3x %3c | %3d %3x %3c ", i+51, i+51, i+51, i+102, i+102, i+102);printf("| %3d %3x

47、%3c | %3d %3x %3cn", i+153, i+153, i+153, i+204, i+204, i+204);return(0);第六步打印一些边框现在,假如需要的话,我们有一个可以在一张A4纸上合理的打印ASCII的图表,我们现在需要做的是给一张表格用一个扩展ASCII特殊字符制作一个边框。/* Title : Print Standard and Extended ASCII chart* Source : print_ascii.c* Author : NJCIT* Version : 2.1*/#include <stdio.h>main()int

48、 i, a;for (a=0; a<71; a+)printf("%c", 205);printf("n");printf("| DEC HEX ASC | DEC HEX ASC | DEC HEX ASC ");printf("| DEC HEX ASC | DEC HEX ASC |n");for (a=0; a<71; a+)printf("%c", 205);printf("n");for (i=1; i<=51; i+) if (i < 3

49、2)printf("| %3d %3x %3s ", i, i, "n/a");elseprintf("| %3d %3x %3c ", i, i, i);printf("| %3d %3x %3c | %3d %3x %3c ", i+51, i+51, i+51, i+102, i+102, i+102);printf("| %3d %3x %3c | %3d %3x %3c |n", i+153, i+153, i+153, i+204, i+204, i+204);for (a=0; a

50、<71; a+)printf("%c", 205);printf("n");return(0);第七步将一些通用的功能转换成函数(进阶)最后的阶段是介绍一个简单函数的概念,一个方法一个C源程序的一个模块,这个模块可以在项目的任何地方被调用(包括函数的内部)。我们从最后一步了解到,一段代码被重复使用了三次,这将是一个方法的理想条件。/* Title : Print Standard and Extended ASCII chart* Source : print_ascii.c* Author : NJCIT* Version : 2.2*/#inc

51、lude <stdio.h>void pretty_line()int a;for (a=0; a<71; a+) printf("%c", 205);printf("n");return;main()int i;/* Print the top border line */pretty_line();/* Print the heading */printf("| DEC HEX ASC | DEC HEX ASC | DEC HEX ASC ");printf("| DEC HEX ASC | DEC

52、HEX ASC |n");/* Print the middle border line */pretty_line();for (i=1; i<=51; i+) if (i < 32)printf("| %3d %3x %3s ", i, i, "n/a");elseprintf("| %3d %3x %3c ", i, i, i);printf("| %3d %3x %3c | %3d %3x %3c ", i+51, i+51, i+51, i+102, i+102, i+102);pr

53、intf("| %3d %3x %3c | %3d %3x %3c |n", i+153, i+153, i+153, i+204, i+204, i+204);/* Print the bottom border line */pretty_line();return(0);第八步扩展打印函数的边界(进阶)这一点它看起来不错,为了使用合适的拐角和分隔栏获得一个专业的边框,我们必须去使用一些扩展字符中的特殊字符。以下是三种类型的线条是必要的:§ 顶线§ 标题下的线条(中间线条)§ 底线一个方法可以有一个通过调用时传入的参数,参数可以是任何类型的

54、(在topic2中讨论),我们就指派一个整数类型作为第一个参数,调用的线条类型如下:§ 0 是顶线§ 1 是中线§ 2 是底线现在,我们观察每一个线条,除了第一个、最后一个和和分栏符,它们基本相同。我们将使用一个例子去选择线条的样式,通过一个变量来改变调用的左右中的符号。最后,我们可以使用嵌套的三个操作打印线条,实际打印的符号是否是根据第一条(a=0)、是否是最后一条(a=70)或者是否是栏分割位置(a % 14 = 0)。/* Title : Print Standard and Extended ASCII chart* Source : print_asci

55、i.c* Author : NJCIT* Version : 3.0*/#include <stdio.h>/* This function prints a line accros the screen.* The line can be one of the following types:* line_type = 0 - The top line* line_type = 1 - The middle line* line_type = 2 - the bottom line*/void pretty_line(int line_type)char left_char, r

56、ight_char, mid_char;char ext_char;int a;/* Set left, right and mid characters depending on line type */switch (line_type) case 0: /* Top line */left_char = 213;right_char = 184;mid_char = 209;break;case 1: /* Middle line */left_char = 198;right_char = 181;mid_char = 216;break;case 2: /* Bottom line

57、*/left_char = 212;right_char = 190;mid_char = 207;break;default: /* Invalid argument passed to us. */left_char = -;right_char = -;mid_char = +;for (a=0; a<71; a+) ext_char = (a=0) ? left_char : (a=70) ? right_char : (a % 14= 0) ? mid_char : 205;printf("%c", ext_char);printf("n");left_char = 198;right_char = 181;mid_char = 216; break;case 2: /* Bottom line */left_char = 212;ri

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论