码迷,mamicode.com
首页 >  
搜索关键字:printf    ( 15030个结果
hdu 4864 Task (贪心)
# include # include # include using namespace std; struct node { int t; int v; int yy; }; struct node a[100010],b[100010]; bool cmp(node a1,node a2) { if(a1.t==a2.t)//先按时间从大到小 return a1.v>a2....
分类:其他好文   时间:2014-07-24 23:10:33    阅读次数:238
P77
#include main() { int x=1,y=0,a=0,b=0; switch(x) { case 1: switch(y) { case 0:a++;break; case 1:b++;break; } case 2:a++;b++;break; case 3:a++;b++; } printf("%d,%d\n",a,b); }...
分类:其他好文   时间:2014-07-24 23:06:53    阅读次数:217
P78
#include main() { int a=-1,b=1; if((++a<0)&&(b--<=0)) printf("%d,%d\n",a,b); else printf("%d,%d\n",b,a); }...
分类:其他好文   时间:2014-07-24 23:04:03    阅读次数:155
选择排序
#includevoid selectSort(int a[],int length);void main(){ int i; float start=0,finish=0; int a[10]={10,15,4,2,5,3,6,9,7,1}; printf("排序前:\...
分类:其他好文   时间:2014-07-24 22:26:02    阅读次数:186
d4_2 指针运算
#includevoid main(){ int a[5]={1,2,3,4,5},i; int *p; p=&a[0]; printf("指针加:\n"); for(i=0;i<5;i++) //addtion { printf("a[%d]...
分类:其他好文   时间:2014-07-24 21:44:32    阅读次数:228
d4_1 字符长度
#includevoid main(){char name[10];int i=0;printf("Enter your name:");scanf("%s",name);printf("Spell it:");while(name[i]!='\0'){ printf("%c ",name[i...
分类:其他好文   时间:2014-07-24 21:25:19    阅读次数:186
psp开发------helloworld
1.创建helloworld.c #include #include PSP_MODULE_INFO("Hello World", 0, 1, 1); #define printf pspDebugScreenPrintf /* Exit callback */ int exit_callback(int arg1, int arg2, void *common) {...
分类:其他好文   时间:2014-07-24 17:45:46    阅读次数:253
整型数字按位取
#include "stdafx.h" #include void countone2(int N) { int a = N; int count = 0; int b ; for (int i=0;i { b = (a>>i)&0x01; printf("%d ",b); if (1 == b) { count ++; } } printf("\n二进制总共有%...
分类:其他好文   时间:2014-07-24 17:44:36    阅读次数:230
简单程序的编译链接三种方法(编译多个源文件,静态链接库、动态链接库)
一个程序简单的程序如下:1 hello.h#ifndef HELLO_H#define HELLO_Hvoid hello(const char *name);#endif2 hello.c#include #include void hello(const char *name){ printf(...
分类:其他好文   时间:2014-07-24 17:06:15    阅读次数:187
Linux文件编程实例
//捕获fopen调用中的错误#include#include#include#defineMYFILE"missing.txt"intmain() { FILE*fin; fin=fopen(MYFILE,"r"); if(fin==(FILE*)NULL) { printf("%s:%s\n",...
分类:系统相关   时间:2014-07-24 16:56:45    阅读次数:298
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!