码迷,mamicode.com
首页 >  
搜索关键字:printf    ( 15030个结果
字符型常量
字符型常量视为int类型 1 #include 2 3 int main(void) 4 { 5 int a = 'ABCD'; 6 int b = 'XYABCD'; 7 printf("%d %c\n", a, a); 8 printf("%d...
分类:其他好文   时间:2014-08-17 01:05:11    阅读次数:150
CUDA C编程入门-不同的grid和block大小对CUDA内建的变量的影响,以及如何确定Thread ID
测试环境 测试的GPU平台为GTX660M,计算能力为3.0首先介绍一下GPU提供的函数:int printf(const char *format[, arg, ...]); 从核函数格式化输出到主机,只支持计算能力在2.x及以上的设备。行为与标准的C相似。这里我们用于输出内建变量的值。核函...
分类:其他好文   时间:2014-08-17 01:03:01    阅读次数:606
打印空心菱形
#includevoid main(){ int i,j,n; printf("请输入 n:\n"); scanf("%d",&n); for(i=0;i0;j--) { printf(" ");/*第一次打空格*/ } printf("*");/*打印第一个'*'号*/ for...
分类:其他好文   时间:2014-08-16 23:38:11    阅读次数:250
第一套二
#include void fun(char *s,int *t); main() { char s[80]="as15dw1zxx1"; int t; printf("\nThe original string is :%s\n",s); fun(s,&t); printf("\nThe result is :%d\n",t); } void fun(char *s,int *t) {...
分类:其他好文   时间:2014-08-16 22:32:51    阅读次数:211
第一套三
#include #include #include int fun(int *x,int y); void main() { int a=3,b=8; system("CLS"); printf("%d %d\n",a,b); b=fun(&a,b); printf("%d %d\n",a,b); } int fun(int *x,int y) { int t; t=*x; *x...
分类:其他好文   时间:2014-08-16 22:31:31    阅读次数:166
自增自减运算法的深入理解
例二: int i=3; int j=4; int a = i++ + i++; int b = ++j + ++j; printf("%d, %d\n", a, b);问题又来了,i++ + i++是先自增一次,相加,再自增,然后赋值呢,还是先相加赋值然后自增两次呢。另外,++j又将如何表现呢?结...
分类:其他好文   时间:2014-08-16 22:27:01    阅读次数:270
调试STM32程序一些浅显又不易发现的问题
1 串口映射Printf后是否勾选上USE MicroLIB ? 今天没有勾选这个选项结果无法进入main函数2 定义计数用的变量cntx时是否大于255但是仍然用的u8 ? u8最大值是255 这个错误非常低级但是总是让人费很大的劲才找到。3 像下面这种语句,这条if后面多了个分号。非常容易被忽略...
分类:其他好文   时间:2014-08-16 18:28:20    阅读次数:203
Pick-up sticks(计算几何_线段相交)
Description Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such th...
分类:其他好文   时间:2014-08-16 17:11:52    阅读次数:272
vc++ release模式下不存_DEBUG宏定义的解决方案
#ifndef#define _DEBUG 0#endif #ifdef _DEBUG#define trace(x) printf(x);#else#define trace(x) ;#endif
分类:编程语言   时间:2014-08-16 17:04:20    阅读次数:193
printf的使用
ASC C之后引入的一个特性是,相邻的字符可以被自动连接 1 #include 2 using namespace std; 3 4 int main() { 5 printf("abcd" 6 "efg\n"); 7 8 char* var[] = { 9 ...
分类:其他好文   时间:2014-08-16 09:43:40    阅读次数:181
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!