摘要: 登录窗实例 (接收和处理数据) String Lusername = this.usernameDL.Text; // 获取并存储控件里面的内容 String Lpassword = this.passwordDL.Text; if (Lusername.Equals("") || Lpassword.Equals("")) //判断输入是否为空 MessageBox.Show("用户名或密码不能 阅读全文
posted @ 2019-10-14 09:04 狗狗王 阅读(465) 评论(0) 推荐(0)
摘要: #include //凑硬币题,1角,2角,5角凑10元,共有多少种组合 int main(){ int a,b,c,i=0; printf("有以下组合\n"); for(a=0;a<=100;a++) for(b=0;b<=50;b++) for(c=0;c<=20;c++) if(a*1+b*2+c*5==100){ i++; ... 阅读全文
posted @ 2019-10-02 21:12 狗狗王 阅读(168) 评论(0) 推荐(0)
摘要: 编译环境:DEVCPP5.0 代码: 阅读全文
posted @ 2019-09-24 14:24 狗狗王 阅读(873) 评论(0) 推荐(0)
摘要: /*使用DEVC++5.0编译通过,新手朋友请注意,启动顺序为打开DEVC++ - 新建项目 - 新建windows application程序(这里不是控制台程序),然后新建HELLOWORD项目,清空MAIN.C代码,将本代码复制进去编译运行即可,具体功能通过修改C代码实现,大家自己去探索。代码保存为.C文件,直接打开无法通过*/截图: 代码如下:#include //#inclu... 阅读全文
posted @ 2019-09-18 23:50 狗狗王 阅读(1284) 评论(2) 推荐(0)
摘要: #include<stdio.h> //定义一个函数判断素数 void sushu(int s){ int i,j,k=0; for(i=2;i<s;i++) if(s%i==0){ k=1; break; } if(k==1) printf("%d不是素数",s); if(k==0) printf("%d是素数"); return 0; } //验证 int main() { int a; wh 阅读全文
posted @ 2019-09-14 10:56 狗狗王 阅读(3458) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<math.h> //定义一元二次方程求根函数函数 void qiugen(float a,float b,float c){ float x,y; if(b*b<4*a*c) printf("该方程没有实根"); else if(b*b==4*a*c){ x=-b/(2*a); printf("该方程有一个根%.2f",x); } else { 阅读全文
posted @ 2019-09-13 17:38 狗狗王 阅读(593) 评论(0) 推荐(0)
摘要: #include //定义一个3*3数组反转函数 void fan(int a[3][3]){ int i,j; int t[3][3]; for(i=0;i<3;i++) for(j=0;j<3;j++) t[i][j]=a[j][i]; for(i=0;i<3;i++){ for(j=0;j<3;j++) printf("%d ",t[i][j]); ... 阅读全文
posted @ 2019-09-12 22:48 狗狗王 阅读(250) 评论(0) 推荐(0)
摘要: 本程序用DEVC++5.0编译 阅读全文
posted @ 2019-09-11 01:13 狗狗王 阅读(624) 评论(0) 推荐(0)
摘要: #include #include /*题目:将一个数组逆序输出*/ int main() { system("color 1F"); // 设定显示框为蓝底白字 system("mode con cols=80 lines=30"); //固定显示框尺寸 /******************************************程序主体分割线(顶部)*****... 阅读全文
posted @ 2019-09-06 14:29 狗狗王 阅读(6615) 评论(0) 推荐(0)
摘要: #include<stdio.h> #include<stdlib.h> /*题目:向数列中插入一个数*/ int main() { system("color 1F"); // 设定显示框为蓝底白字 system("mode con cols=80 lines=30"); //固定显示框尺寸 /******************************************程序主体分割线(顶 阅读全文
posted @ 2019-09-05 21:59 狗狗王 阅读(1153) 评论(0) 推荐(0)