当前位置:三九宝宝网 → 宝宝教育 → 教学论文 → 正文

用C语言编写下面介绍的程序

更新:02-22 整理:39baobao.com
字体:

[用C语言编写二分法解方程程序]#include <stdio.h> #include <math.h> float getvalue(float x) { return x*x*x+4*x*x-10; } void main() { float a=1,b=1.5,c; c=(a+b)/2; while(fabs(getvalue(c))>0.00...+阅读

展开1全部 #include "stdio.h"#include "ctype.h"void myDelay( int iSecond );void Translate( char letter, char *CodeStr ); void printMorse(char *CodeStr) ;struct MCode{ char letter; char CodeStr[27];};struct MCode myMCode[27]; main(){ int i; char InputStr[256]; char PrintCodeStr[27]; myMCode[0].letter = 'A'; strcpy(myMCode[0].CodeStr, ".-"); myMCode[1].letter = 'B'; strcpy(myMCode[1].CodeStr, "-..."); myMCode[2].letter = 'C'; strcpy(myMCode[2].CodeStr, "-.-."); myMCode[3].letter = 'D'; strcpy(myMCode[3].CodeStr, "-.."); myMCode[4].letter = 'E'; strcpy(myMCode[4].CodeStr, "."); myMCode[5].letter = 'F'; strcpy(myMCode[5].CodeStr, "..-."); myMCode[6].letter = 'G'; strcpy(myMCode[6].CodeStr, "--."); myMCode[7].letter = 'H'; strcpy(myMCode[7].CodeStr, "...."); myMCode[8].letter = 'I'; strcpy(myMCode[8].CodeStr, ".."); myMCode[9].letter = 'J'; strcpy(myMCode[9].CodeStr, ".---"); myMCode[10].letter = 'K'; strcpy(myMCode[10].CodeStr, "-.-"); myMCode[11].letter = 'L'; strcpy(myMCode[11].CodeStr, ".-.."); myMCode[12].letter = 'M'; strcpy(myMCode[12].CodeStr, "--"); myMCode[13].letter = 'N'; strcpy(myMCode[13].CodeStr, "-."); myMCode[14].letter = 'O'; strcpy(myMCode[14].CodeStr, "---"); myMCode[15].letter = 'P'; strcpy(myMCode[15].CodeStr, ".--."); myMCode[16].letter = 'Q'; strcpy(myMCode[16].CodeStr, "--.-"); myMCode[17].letter = 'R'; strcpy(myMCode[17].CodeStr, ".-.-"); myMCode[18].letter = 'S'; strcpy(myMCode[18].CodeStr, "..."); myMCode[19].letter = 'T'; strcpy(myMCode[19].CodeStr, "-"); myMCode[20].letter = 'U'; strcpy(myMCode[20].CodeStr, "..-"); myMCode[21].letter = 'V'; strcpy(myMCode[21].CodeStr, "...-"); myMCode[22].letter = 'W'; strcpy(myMCode[22].CodeStr, ".--"); myMCode[23].letter = 'X'; strcpy(myMCode[23].CodeStr, "-..-"); myMCode[24].letter = 'Y'; strcpy(myMCode[24].CodeStr, "-.-"); myMCode[25].letter = 'Z'; strcpy(myMCode[25].CodeStr, "--.."); myMCode[26].letter = ' '; strcpy(myMCode[26].CodeStr, "\n"); printf("The zimu and morse:\n"); for( i = 0; i

本文地址:https://www.39baobao.com/show/29_44452.html

以上内容来自互联网,请自行判断内容的正确性。若本站收录的信息无意侵犯了贵司版权,请联系我们,我们会及时处理和回复,谢谢.

以下为关联文档:

用C语言编写矩阵求逆的程序1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 int a[4][4]; for(int i=0;i<4;i++){ for(int j=0;j<4;j++){ a[i][j] = i*4+j+1; } } fo...

用C语言编写一个计算薪水的程序/*工资计算程序*/ #include main() { float originWage; /*应发工资*/ float realWage; /*实发工资*/ float tax; /*所缴税款*/ int i,hour,amount,money; printf("请选择工资种...

用C语言编写计算三角函数的程序math.h里的三角函数用的单位是弧度,你貌似错在这里。 答案补充 Example /* SINCOS.C: This program displays the sine, hyperbolic * sine, cosine, and hyperbolic cosine...

用C语言编写程序计算阶梯数 #include main() { int i=2; while(1){ i++; if(i%2==1&i%3==2&i%4==3&i%5==4&i%6==5&i%7==0) break; } printf("%d",i); }如图所示,望采纳。。。。。。...

图书信息管理程序用C语言编写#include#include#include#include#include#define STACK_INIT_SIZE 10 #define OK 1 #define TRUE 1 #define FALSE 0 #define ERROR 0 struct student /*定义学生类型,用于...

用c语言编写一个简单的程序main() { int a,b,i; bool flag = true; for (i = 0; i < 6; i++) { scanf("%d", &a); if (flag) { b = a; flag = false; } else { if (b > a) b = a; } } prinf("%d", b); }...

用C语言编写贪吃蛇游戏的程序回答:Mr.emily 大师 6月3日 16:45 #define N 200 #include#include#include#define LEFT 0x4b00 #define RIGHT 0x4d00 #define DOWN 0x5000 #define UP 0x4800 #define Esc...

用C语言中的结构体编写程序#include<stdio.h> struct book{ char name[10]; int num; }book; int main() { int i; struct book b[20]; for(i=0;i<20;i++)//依次读入20个书名 {scanf("%s",&b[i].name);...

用c语言编写一个程序实现以下功能1 2 3 4 5 6 7 8 9 10 #include "stdio.h" intmain(intargc,char*argv[]){ 5261int a,b; doublex,y; charch1,ch2; printf("Please enter the data...\n"); scanf("%d%d%lf%lf %c...