#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <termios.h>
#include <sys/types.h>
#include <s……继续阅读 »
10年前 (2015-05-11) 1137浏览 0评论
0个赞
c语言
pipe?write
代码是这样的
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#define k 1024
#……继续阅读 »
10年前 (2015-05-11) 1232浏览 0评论
0个赞
我用的是将n次方分解为多次循环相乘,每次取相乘后的积的最后一位作为新的一个因数,但当要求的数比较大的时候用时会比较长,请问有什么更优的算法去解决这个问题吗?求大神指点迷津,谢谢
题目如下:
20分
只取个位数,个数只有[0,9], 作表算出循环数,直接查表算就行了
20分
跟这个题目一样:
http://acm.hdu……继续阅读 »
10年前 (2015-05-11) 1356浏览 0评论
0个赞
本人疑惑代码如下:
#include<stdio.h>
int main()
{
int n,i,t;
int a[10000]= {0};
for(i=2; i<10000; i++)//建立10000以内的素数表
if(!a[i])
for(t=i+i; t&……继续阅读 »
10年前 (2015-05-11) 1143浏览 0评论
0个赞
The C programming language K&R 书中有这么一段话:
Nonetheless, macros are valuable. One practical example comes from <stdio.h> , in which
getchar and putchar are often defi……继续阅读 »
10年前 (2015-05-11) 1182浏览 0评论
0个赞
static struct GT2005_platform_data GT2005_plat = {
.default_width = 640,
.default_height = 480,
.pixelformat = V4L2_PIX_FMT_UYVY, // .freq = 24000000, ……继续阅读 »
10年前 (2015-05-11) 1327浏览 0评论
0个赞
这是题目内容:
下面是我自己写的代码,但提交后是超时(Time Limit Exceeded),请教大神有什么更优的解法吗
#include<stdio.h>
int main()
{
int T,n,i,a[10003],t,sum,max;
scanf(“%d”,&T);
……继续阅读 »
10年前 (2015-05-11) 1314浏览 0评论
0个赞
c语言
编译器
这是相同的程序第一个是vc++ 6.0编译器,第二个是codeblocks的gcc编译器,两次结果却很不相同,这是为什么呢
意外,匪夷所思,你再试试
不大可能吧
你确定codeblocks执行的代码是这个?
引用 1 楼 zhangxiangDavaid 的回复:
意外,匪夷所思,你再试试
……继续阅读 »
10年前 (2015-05-11) 2036浏览 0评论
0个赞
c语言
10个人,然后数到第5个出局,程序得出的结果是第一个数数到5,然后出局,而之后的数都是数到4就出局,这里有点不明白程序错在哪里,该怎么改。
#include <stdlib.h>
#include<stdio.h>
struct node{
int data;
struct node *next;
}nod……继续阅读 »
10年前 (2015-05-11) 1397浏览 0评论
0个赞