摘要: #include <stdio.h> main() { int fahr; for (fahr = 0; fahr <= 300; fahr = fahr + 20) printf("%3d %6.1f\n", fahr, (5.0/9.0)*(fahr-32)); } 通过 为知笔记 发布 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(99) 评论(0) 推荐(0)
摘要: #include <stdio.h> main() { int fahr=0; int celsius; int step=20; while (fahr <= 300) { celsius = 5 * (fahr-32) / 9; printf("%d\t%d\n", fahr, celsius); fahr = fahr + 20; } } int 整型char 字符——一个字... 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(98) 评论(0) 推荐(0)
摘要: #include <stdio.h> main() { printf("hello, world\n"); } 通过 为知笔记 发布 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(209) 评论(0) 推荐(0)
摘要: 变量名对变量的命名与符号常量的命名存在一些限制条件, 名字是由字母和数字组成的序列,但其第一个字符必须为字母。下划线“_”被看做是字母, 大写字母与小写字母是有区别的,所以,x与X是两个不同的名字。 变量名使用小写字母, 符号常量名全部使用大写字母。 局部变量一般使用较短的变量名(尤其是循环控制变量), 外部变量使用较长的名字。 数据类型及长度 C语言只提供了下列几种基本数据类型: ... 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(170) 评论(0) 推荐(0)
摘要: 使用设计正确的函数,程序员无需考虑功能是如何实现的,而只需知道它具有哪些功能就够了,和如何使用函数就够了。#include <stdio.h>/*公共声明函数*/int myAdd(int x,int y);void main(){int a=1;int b=2;printf("%d\n",myAdd(a,b));/*调用函数*/}/*自动定义的加法函数*/int myAdd(int x,int ... 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(118) 评论(0) 推荐(0)
摘要: //getchar函数从文本流中读入下一个输入字符,并将其作为结果值返回c = getchar() 每次调用putchar函数时将打印一个字符putchar() ////#include <stdio.h> main() { int c; c = getchar(); while (c != EOF) { putchar(c); c = getchar(); } } //这里需要解决... 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(101) 评论(0) 推荐(0)
摘要: #define 名字 替换文本 #include <stdio.h> #define LOWER 0 #define UPPER 300 #define STEP 20 main() { int fahr; for (fahr = LOWER; fahr <= UPPER; fahr = fahr + STEP) printf("%3d %6.1f\n", fahr, (5.0/9.0)*(... 阅读全文
posted @ 2012-06-26 19:12 XE2011 阅读(460) 评论(0) 推荐(0)
摘要: /********************************************************//*DLL中的函数定义*//*计算x+y的值*/ int __declspec(dllexport) __stdcall myAdd(int x, int y) {return x+y; } /*********************************************... 阅读全文
posted @ 2012-06-26 18:38 XE2011 阅读(290) 评论(0) 推荐(0)
摘要: /*设置屏幕分辨率width,Height,Color->SetPixelAndColor(1024,768,32)*/bool SetPixelAndColor(HDChdc,unsigned int Width,unsigned int Height,int BitsPerPixel){DEVMODECurMode;intresult=1;for(int i=0;result;i++)resu... 阅读全文
posted @ 2012-06-26 18:38 XE2011 阅读(245) 评论(0) 推荐(0)
摘要: MessageBeep(MB_OK);发声if(MessageDlg("Are you sure to Exit",mtConfirmation, TMsgDlgButtons()<<mbYes<<mbNo,0)==mrYes){Close();}Application->ProcessMessages();MessageBox(this->Handle,"Text","Tips",MB_OK|M... 阅读全文
posted @ 2012-06-26 18:38 XE2011 阅读(370) 评论(0) 推荐(0)
摘要: //首先创建好1窗体2//project->option->设置不自动创建窗体//当有多个窗体的时候 需要的时候才创建这个创建否则不创建 Form2=newTForm2(Application); Form2->ShowModal(); deleteForm2;//窗体的关闭部分 Form2->Free();通过 为知笔记 发布 阅读全文
posted @ 2012-06-26 18:38 XE2011 阅读(143) 评论(0) 推荐(0)
摘要: void__fastcallTForm1::Button1Click(TObject*Sender) { intx,y; x=Edit1->Text.ToInt(); y=Edit2->Text.ToInt(); Edit3->Text=x+y; } 通过 为知笔记 发布 阅读全文
posted @ 2012-06-26 18:37 XE2011 阅读(138) 评论(0) 推荐(0)