![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c语言编程
lzl0351
这个作者很懒,什么都没留下…
展开
-
小程序:输入1-1000以内的数字,除7余5,除5余1,每行输出8个数字
#include"stdio.h"void main(){int i,j=0;for (i=1 ; i{if(i%7==5 && i%5==1 ) {printf(" %d ",i);j++;if(j%8==0) printf("\n");}}}原创 2017-06-26 09:45:06 · 2616 阅读 · 0 评论 -
VC 常用技巧总结 - 108条(转http://www.cctry.com/thread-258-1-1.html)
<br />(1) 如何通过代码获得应用程序主窗口的 指针?主窗口的 指针保存在CWinThread::m_pMainWnd中,调用AfxGetMainWnd实现。 AfxGetMainWnd() ->ShowWindow(SW_SHOWMAXMIZED) //使程序最大化. <br />(2) 确定应用程序的路径 Use GetModuleFileName 获得应用程序的路径,然后去掉可执行文件名。 Example: TCHAR exeFullPath[MAX_PATH] // MAX_PATH在API中转载 2010-09-10 11:46:00 · 1832 阅读 · 0 评论 -
小程序:逆序输出一个整数
#include "stdio.h"int fun(int n){if(n!=0){printf("%d " , n%10);return fun(n/10);}}void main(){long n;printf("input a number: \n");scanf(" %ld" , &n);fun(n);}一种是原创 2017-06-26 10:07:57 · 1216 阅读 · 1 评论 -
求正整数分解质因数
#include"stdio.h"//#define PI 3.14void main(){int n,i=2;printf("\n please input a number: ");scanf("%d" , &n);printf("%d = " , n);while(i{while(n!=i){if(n%i == 0){print原创 2017-06-26 21:51:32 · 302 阅读 · 0 评论