题目描述:给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。现在请计算A+B的结果,并以正常形式输出。输入:输入包含多组数据数据,每组数据占一行,由两个整数A和B组成(-10^9 3 int main(int argc, char const *argv[]) 4 { 5 .....
分类:
其他好文 时间:
2014-07-22 22:51:14
阅读次数:
278
源地址:http://blog.csdn.net/xcy2011sky/article/details/7168376解决中文乱码,最好知道乱码是什么格式比如说:utf-8.解决方案:1.让整个应用程序支持中文: 在 QApplication a(argc, argv);后加上以下几句话即可。要包含...
分类:
其他好文 时间:
2014-07-22 00:36:35
阅读次数:
192
下面我们用最简单的一对一的客户服务器模型来重现编程中遇到的一些问题:
初学socket的时候在编写socket程序的时候会遇到很多莫名其妙的问题,比如说bind函数返回的常见错误是EADDRINUSE
使用下面的程序重现这个状态:
client:
int main(int argc, const char * argv[])
{
struct sockaddr_in ...
分类:
其他好文 时间:
2014-07-19 23:36:19
阅读次数:
427
#import #import "Person.h"#import "BankAccount.h"int main(int argc, const char * argv[]){// 实例化一个人, 表示是这个名字叫wangdelong的人, 准备在银行开户 Person *person = [[....
分类:
其他好文 时间:
2014-07-19 21:38:02
阅读次数:
272
1. 顺序容器的初始化操作1.1 顺序容器(vector,list,deque)的五种初始化方法,以 vector 为例。#include #include #include using namespace std;int main(int argc, const char *argv[]){ .....
分类:
编程语言 时间:
2014-07-19 19:27:08
阅读次数:
278
file/filetype.c #include "apue.h"intmain(int argc, char *argv[]){ int i; struct stat buf; char *ptr; for (i = 1; i < argc; i++) { printf("%s: ", argv[...
分类:
其他好文 时间:
2014-07-18 23:38:27
阅读次数:
412
#include "stdafx.h"int _tmain(int argc, _TCHAR* argv[]){ int a = 1, b = 1, c = 0; int max = 0x7FFFFFFF; printf("%d\n", max);// 打印一下整型的最大值 ...
分类:
其他好文 时间:
2014-07-18 23:36:57
阅读次数:
191
file/fileflags.c #include "apue.h"#include intmain(int argc, char *argv[]){ int val; if (argc != 2) err_quit("usage: a.out "); if ((val = fcntl(atoi(a...
分类:
其他好文 时间:
2014-07-18 23:28:24
阅读次数:
203
最近在写程序的过程中,把一部分时间都花费在程序对参数的处理上。今天听了学长说到getopt函数,才发现原来c里面还有一个专门解决参数处理的函数,查询了相关资料,这里简单总结一下。使用int main( int argc, char *argv[] )(或int main( int argc, cha...
分类:
其他好文 时间:
2014-07-18 14:17:53
阅读次数:
227
fopen打开配置文件,不需要绝对路径,可以使相对路径fgets按行读取文件while(fgets(buf, 1024, fptr)){}strtok_r或者strtok解析参数 int main(int argc, char *argv[]) { ...
分类:
其他好文 时间:
2014-07-18 12:14:09
阅读次数:
187