【转】gcc错误表
<!-- /post --><!-- tabbed content --><!-- tab navigation (items must be in reverse order because of the tab-design) --><!-- /tab nav --><!-- tab sections --><!-- comments --><!-- /comments --><!-- trackbacks --><!-- /trackbacks --><!-- related posts --><!-- short post -->conversion from %s to %s not supported by iconv”
iconv 不支持从 %s 到 %s 的转换”iconv_open”
iconv_open”no iconv implementation, cannot convert from %s to %s”
没有 iconv 的实现,无法从 %s 转换到 %s”character 0x%lx is not in the basic source character set\n”
字符 0x%lx 不在基本源字符集中\n”converting to execution character set”
转换到可执行文件的字符集”character 0x%lx is not unibyte in execution character set”
字符 0x%lx 在执行字符集中不是单字节的”Character %x might not be NFKC”
字符 %x 可能不是 NFKC”universal character names are only valid in C++ and C99″
Unicode 字符名只在 C++ 和 C99 中有效”the meaning of ‘\\%c’ is different in traditional C”
‘\\%c’的意义与在传统 C 中不同”In _cpp_valid_ucn but not a UCN”
在 _cpp_valid_ucn 中但不是一个 UCN”incomplete universal character name %.*s”
不完全的 Unicode 字符名 %.*s”%.*s is not a valid universal character”
%.*s 不是一个有效的 Unicode 字符”‘$’ in identifier or number”
‘$’出现在标识符或数字中”universal character %.*s is not valid in an identifier”
Unicode 字符 %.*s 在标识符中无效”universal character %.*s is not valid at the start of an identifier”
Unicode 字符 %.*s 在标识符开头无效”converting UCN to source character set”
将 UCN 转换到源字符集”converting UCN to execution character set”
将 UCN 转换到执行字符集”the meaning of ‘\\x’ is different in traditional C”
‘\\x’的意义与在传统 C 中不同”\\x used with no following hex digits”
\\x 后没有 16 进制数字”hex escape sequence out of range”
16 进制转义序列越界”octal escape sequence out of range”
8 进制转义序列越界”the meaning of ‘\\a’ is different in traditional C”
‘\\a’的意义与在传统 C 中不同”non-ISO-standard escape sequence, ‘\\%c’”
非 ISO 标准的转义序列,‘\\%c’”unknown escape sequence: ‘\\%c’”
未知的转义序列:‘\\%c’”unknown escape sequence: ‘\\%s’”
未知的转义序列:‘\\%s’”converting escape sequence to execution character set”
将转义序列转换到执行字符集”character constant too long for its type”
字符常量大小超出其类型”multi-character character constant”
多字节字符常量”empty character constant”
空的字符常量”failure to convert %s to %s”
无法从 %s 转换到 %s”extra tokens at end of #%s directive”
#%s 指示的末尾有多余的标识符”#%s is a GCC extension”
#%s 是一个 GCC 扩展”#%s is a deprecated GCC extension”
#%s 是一个已过时的 GCC 扩展”suggest not using #elif in traditional C”
建议在传统 C 中不使用 #elif”traditional C ignores #%s with the # indented”
当 # 有缩进时传统 C 忽略 #%s”suggest hiding #%s from traditional C with an indented #”
建议使用缩进的 # 以让 #%s 对传统 C 不可见”embedding a directive within macro arguments is not portable”
将一个指示嵌入宏参数中是不可移植的”style of line directive is a GCC extension”
line 指示的风格是一个 GCC 扩展”invalid preprocessing directive #%s”
无效的预处理指示 #%s”\”defined\” cannot be used as a macro name”
“defined”不能被用作宏名”\”%s\” cannot be used as a macro name as it is an operator in C++”
“%s”不能被用作宏名,因为它是 C++ 中的一个操作符”no macro name given in #%s directive”
#%s 指示中未给出宏名”macro names must be identifiers”
宏名必须是标识符”undefining \”%s\”"
取消对“%s”的定义”missing terminating > character”
缺少结尾的 > 字符”#%s expects \”FILENAME\” or ”
#%s 需要 \”FILENAME\” 或 ”?
empty filename in #%s”
#%s 中文件名为空”#include nested too deeply”
#include 嵌套过深”#include_next in primary source file”
#include_next 出现在主源文件中”invalid flag \”%s\” in line directive”
line 指示中有无效的标记“%s””unexpected end of file after #line”
#line 后未预期的文件结束”\”%s\” after #line is not a positive integer”
#line 后的“%s”不是一个正整数”line number out of range”
行号超出范围”\”%s\” is not a valid filename”
“%s”不是一个有效的文件名”\”%s\” after # is not a positive integer”
# 后的“%s”不是一个正整数”invalid #%s directive”
无效的 #%s 指示”registering pragmas in namespace \”%s\” with mismatched name expansion”
在命名空间“%s”中注册 pragma 时名称扩展不匹配”registering pragma \”%s\” with name expansion and no namespace”
pragma “%s”被注册为一个命名扩展,而没有命名空间”registering \”%s\” as both a pragma and a pragma namespace”
“%s”既被注册为一个pragma 又被注册为一个 pragma 命名空间”#pragma %s %s is already registered”
#pragma %s %s 已经被注册”#pragma %s is already registered”
#pragma %s 已经被注册”registering pragma with NULL handler”
pragma 注册为被 NULL 处理”#pragma once in main file”
#pragma once 出现在主文件中”invalid #pragma push_macro directive”
无效的 #pragma push_macro 指示”invalid #pragma pop_macro directive”
无效的 #pragma pop_macro 指示”invalid #pragma GCC poison directive”
无效的 #pragma GCC poison 指示”poisoning existing macro \”%s\”"
对已存在的宏“%s”投毒”#pragma system_header ignored outside include file”
#pragma system_heade 在包含文件外被忽略”cannot find source file %s”
找不到源文件 %s”current file is older than %s”
当前文件早于 %s”_Pragma takes a parenthesized string literal”
_Pragma 需要一个括起的字符串字面常量”#else without #if”
#else 没有匹配的 #if”#else after #else”
#else 出现在 #else 后”the conditional began here”
条件自此开始”#elif without #if”
#elif 没有匹配的 #if”
#elif after #else”
#elif 出现在 #else 后”#: directives.c:1960
#endif without #if”
#endif 没有匹配的 #if”missing ‘(‘ after predicate”
谓词后缺少‘(’”missing ‘)’ to complete answer”
完整的答案缺少‘)’”predicate’s answer is empty”
谓词的答案为空”assertion without predicate”
断言后没有谓词”predicate must be an identifier”
谓词必须是一个标识符”\”%s\” re-asserted”
重断言“%s””unterminated #%s”
未终止的 #%s”unterminated comment”
未结束的注释”stdout”
stdout”%s: %s”
%s:%s”too many decimal points in number”
数字中有太多小数点”fixed-point constants are a GCC extension”
定点常量是一个 GCC 扩展”invalid digit \”%c\” in binary constant”
二进制常量中有无效数字“%c””invalid digit \”%c\” in octal constant”
8 进制常量中有非法字符“%c””invalid prefix \”0b\” for floating constant”
浮点常量的“0b”前缀无效”use of C99 hexadecimal floating constant”
使用 C99 式的 16 进制浮点常量”exponent has no digits”
指数部分没有数字”hexadecimal floating constants require an exponent”
16 进制浮点常量需要指数部分”invalid suffix \”%.*s\” on floating constant”
浮点常量的“%.*s”后缀无效”traditional C rejects the \”%.*s\” suffix”
传统 C 不接受“%.*s”后缀”suffix for double constant is a GCC extension”
双精度常量后缀是一个 GCC 扩展”invalid suffix \”%.*s\” with hexadecimal floating constant”
十六进制浮点常量的“%.*s”后缀无效”decimal float constants are a GCC extension”
十进制浮点常量是一个 GCC 扩展”invalid suffix \”%.*s\” on integer constant”
整数常量的“%.*s”后缀无效”use of C++0x long long integer constant”
使用 C++0x long long 整数常量”imaginary constants are a GCC extension”
虚数常量是一个 GCC 扩展”binary constants are a GCC extension”
二进制常量是一个 GCC 扩展”integer constant is too large for its type”
整数常量值超出其类型”integer constant is so large that it is unsigned”
整数常量太大,认定为 unsigned”missing ‘)’ after \”defined\”"
“defined” 后出现‘)’”operator \”defined\” requires an identifier”
操作符“defined”需要一个标识符”(\”%s\” is an alternative token for \”%s\” in C++)”
(在 C++ 中“%s”会是“%s”的替代标识符)”this use of \”defined\” may not be portable”
使用“defined”可能不利于移植”floating constant in preprocessor expression”
浮点常量出现在预处理表达式中”imaginary number in preprocessor expression”
预处理表达式中出现虚数”\”%s\” is not defined”
“%s”未定义”assertions are a GCC extension”
断言是一个 GCC 扩展”assertions are a deprecated extension”
断言是一个已过时的 GCC 扩展”missing binary operator before token \”%s\”"
标识符“%s”前缺少二元运算符”token \”%s\” is not valid in preprocessor expressions”
标识符“%s”在预处理表达式中无效”missing expression between ‘(‘ and ‘)’”
‘(’与‘)’之间缺少表达式”%s with no expression”
%s 后没有表达式”operator ‘%s’ has no right operand”
操作符‘%s’没有右操作数”operator ‘%s’ has no left operand”
操作符‘%s’没有左操作数”‘:’ without preceding ‘?’”
‘:’前没有‘?’”unbalanced stack in %s”
%s 中堆栈不平衡”impossible operator ‘%u’”
不可能的操作‘%u’”missing ‘)’ in expression”
表达式中缺少‘)’”‘?’ without following ‘:’”
‘?’后没有‘:’”integer overflow in preprocessor expression”
预处理表达式中整数溢出”missing ‘(‘ in expression”
表达式中缺少‘(’”the left operand of \”%s\” changes sign when promoted”
“%s”的左操作数在提升时变换了符号”the right operand of \”%s\” changes sign when promoted”
“%s”的右操作数在提升时变换了符号”traditional C rejects the unary plus operator”
传统 C 不接受单目 + 运算符”comma operator in operand of #if”
#if 操作数中出现逗号”division by zero in #if”
#if 中用零做除数”NULL directory in find_file”
find_file 中有 NULL 目录”one or more PCH files were found, but they were invalid”
找到一个或多个 PCH 文件,但它们是无效的”use -Winvalid-pch for more information”
使用 -Winvalid-pch 以获得更多信息”%s is a block device”
%s 是一个块设备”%s is too large”
%s 过大”%s is shorter than expected”
%s 短于预期”no include path in which to search for %s”
没有包含路径可供搜索 %s”Multiple include guards may be useful for:\n”
多个防止重包含可能对其有用:\n”cppchar_t must be an unsigned type”
cppchar_t 必须是无符号型”preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits”
预处理算术的最高精度为 %lu 位;目标需要 %lu 位”CPP arithmetic must be at least as precise as a target int”
CPP 算术必须至少具有目标 int 的精度”target char is less than 8 bits wide”
目标 char 短于 8 位”target wchar_t is narrower than target char”
目录 wchar_t 短于目标 char”target int is narrower than target char”
目标 int 短于目标 char”CPP half-integer narrower than CPP character”
CPP 半整数短于 CPP 字符”CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu bits”
在此宿主机上,CPP 不能处理长于 %lu 位的宽字符常量,但目标需要 %lu 位”backslash and newline separated by space”
反斜杠和换行为空格所分隔”backslash-newline at end of file”
反斜杠续行出现在文件末尾”trigraph ??%c converted to %c”
三元符 ??%c 转换为 %c”trigraph ??%c ignored, use -trigraphs to enable”
三元符 ??%c 被忽略,请使用 -trigraphs 来启用”\”/*\” within comment”
“/*”出现在注释中”%s in preprocessing directive”
预处理指示中出现 %s”null character(s) ignored”
忽略空字符”`%.*s’ is not in NFKC”
‘%.*s’不在 NFKC 中”`%.*s’ is not in NFC”
‘%.*s’不在 NFC 中”attempt to use poisoned \”%s\”"
试图使用有毒的“%s””__VA_ARGS__ can only appear in the expansion of a C99 variadic macro”
__VA_ARGS__ 只能出现在 C99 可变参数宏的展开中”identifier \”%s\” is a special operator name in C++”
标识符“%s”是 C++ 中的一个特殊操作符”raw string delimiter longer than 16 characters”
原始字符串分隔符长过 16 个字符”invalid character ‘%c’ in raw string delimiter”
原始字符串分隔符中有无效字符‘%c’”unterminated raw string”
未终止的原始字符串”null character(s) preserved in literal”
空字符将保留在字面字符串中”missing terminating %c character”
缺少结尾的 %c 字符”C++ style comments are not allowed in ISO C90″
C++ 风格的注释在 ISO C90 中不被允许”(this will be reported only once per input file)”
(此警告为每个输入文件只报告一次)”multi-line comment”
多行注释”unspellable token %s”
无法拼出的标识符 %s”macro \”%s\” is not used”
宏“%s”未被使用”invalid built-in macro \”%s\”"
无效的内建宏“%s””could not determine file timestamp”
无法决定文件的时间戳”could not determine date and time”
无法决定日期与时间”__COUNTER__ expanded inside directive with -fdirectives-only”
带 -fdirectives-only 时 __COUNTER__ 在指示中扩展”invalid string literal, ignoring final ‘\\’”
无效的字面字符串,忽略最后的‘\\’”pasting \”%s\” and \”%s\” does not give a valid preprocessing token”
毗连“%s”和“%s”不能给出一个有效的预处理标识符”ISO C99 requires rest arguments to be used”
ISO C99 需要使用剩余的参数”macro \”%s\” requires %u arguments, but only %u given”
宏“%s”需要 %u 个参数,但只给出了 %u 个”macro \”%s\” passed %u arguments, but takes just %u”
宏“%s”传递了 %u 个参数,但只需要 %u 个”unterminated argument list invoking macro \”%s\”"
调用宏“%s”时参数列表未终止”function-like macro \”%s\” must be used with arguments in traditional C”
类似函数的宏“%s”在传统 C 中必须与参数一起使用”invoking macro %s argument %d: empty macro arguments are undefined in ISO C90 and ISO C++98″
调用宏 %s 的参数 %d:空的宏参数未被 ISO C90 和 ISO C++98 定义”duplicate macro parameter \”%s\”"
重复的宏参数“%s””\”%s\” may not appear in macro parameter list”
“%s”不能出现在宏参数列表中”macro parameters must be comma-separated”
宏参数必须由逗号隔开”parameter name missing”
缺少形参名”anonymous variadic macros were introduced in C99″
匿名可变参数宏在 C99 中被引入”ISO C does not permit named variadic macros”
ISO C 不允许有名的可变参数宏”missing ‘)’ in macro parameter list”
在宏参数表中缺少‘)’”‘##’ cannot appear at either end of a macro expansion”
‘##’不能出现在宏展开的两端”ISO C99 requires whitespace after the macro name”
ISO C99 要求宏名后必须有空白”missing whitespace after the macro name”
宏名后缺少空白”‘#’ is not followed by a macro parameter”
‘#’后没有宏参数”\”%s\” redefined”
“%s”重定义”this is the location of the previous definition”
这是先前定义的位置”macro argument \”%s\” would be stringified in traditional C”
宏参数“%s”将在传统 C 中被字符串化”invalid hash type %d in cpp_macro_definition”
cpp_macro_definition 中有无效的散列类型 %d”while writing precompiled header”
在写入预编译头时”%s: not used because `%.*s’ is poisoned”
%s:未使用因为‘%.*s’已被投毒”%s: not used because `%.*s’ not defined”
%s:未使用因为‘%.*s’未定义”%s: not used because `%.*s’ defined as `%s’ not `%.*s’”
%s:未使用因为‘%.*s’被定义为‘%s’而非‘%*.s’”%s: not used because `%s’ is defined”
%s:未使用因为‘%s’已定义”%s: not used because `__COUNTER__’ is invalid”
%s:未使用因为‘__COUNTER__’无效”while reading precompiled header”
在读取预编译头时”detected recursion whilst expanding macro \”%s\”"
展开宏“%s”时检测到递归”syntax error in macro parameter list”
宏参数列表语法错误”#~ warning: ”
#~ 警告:”#~ internal error: ”
#~ 内部错误:”#~ error: ”
#~ 错误:”#~ In file included from %s:%u”
#~ 在包含自 %s:%u 的文件中”#~ ”
#~ “,\n”
#~ ” from %s:%u”
#~ ”
#~ “,\n”
#~ ” 从 %s:%u”#~ no newline at end of file”
#~ 文件未以空白行结束”
大约2天前 -
conky是个非常棒的 系统监视器..
不过好的软件当然也需要好的配置文件。。
昨天装好了 Ubuntu10.04…(本来是beta的 格了重新装了..)
然后就配了一下conky 感觉这会是我配的比较好的一次了
配色上可能很差劲- -..见谅。。。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
background yes
cpu_avg_samples 2
net_avg_samples 2
out_to_console no
override_utf8_locale yes
use_xft yes
xftfont 微软雅黑:size=10
xftalpha 0.8
update_interval 1
own_window yes
own_window_transparent yes
own_window_hints undecorated,below,skip_taskbar
double_buffer yes
minimum_size 260 5
maximum_width 200
draw_shades no
draw_outline no
draw_borders no
stippled_borders no
border_margin 4
border_width 1
default_color white
default_shade_color white
default_outline_color white
gap_x 5
gap_y 35
alignment top_right
use_spacer none
no_buffers yes
uppercase no
?
TEXT
${font 微软雅黑:size=30}${time %H:%M}${font}${alignr}${time %B} ${time %Y}
${font DejaVu Sans Mono:size=8}${color}${execpi 60 DJS=`date +%_d`; cal | sed ‘1d’ |
大约1周前 -
今天参加省选了。。。 这是题目 自己手打的题目
2010河南省信息学奥林匹克竞赛试题(高中组选拔赛一试)
考试时间:210分钟(3小时30分)
题目
源文件名(*.c/cpp/pas)
输入数据文件
输出数据文件
测试点时限
内存限制
测试点个数
计数
perm
perm.in
perm.out
1s
512 MB
10
工厂选址
factory
factory.in
factory.out
1s
512 MB
10
软件安装
install
install.in
install.out
1s
512 MB
10
第1题:计数(文件名:perm.pas/c/cpp,时限1s)
你有一组非零数字(不一定唯一),你可以在其中插入任意个0,这样就可以产生无限个数。比如说给定{1,2},那么可以生成数字12,21,102,120,201,210,1002,10200,等等。
现在给定一个数,问在这个数之前有多少个数。(注意这个数不会有前导0)。
输入
只有1行,为1个整数n.
输出
只有整数,表示N之前出现的数的个数。
样例
perm.in
1020
perm.out
7
数据范围:n的长度不超过50,答案不超过263-1.
第2题:工厂选址(文件名:factory.c/cpp/pas,时限1s)
某地区有m左煤矿,其中第i号矿每年产量为ai吨,现有火力发电站一个,每年需用煤b吨,每年运行的固定费用(包括折旧费,不包括煤的运费)为h元,每吨原煤从第i号矿运到原有发电厂的运费为Ci0(i=1,2,…,m;j=1,2,…,n)。
现规划新建一个发电厂,m座煤矿每年开采的原煤将全部供给这两座发电厂。现有n个备选的厂址。若在第j号备选厂址建新厂,每年运行的固定费用为hi元。每吨原煤从第i号矿运到j号备选厂址的运费为Cij(i=1,2,…,m;j=1,2,…,n)。
试问:应把新厂厂址选取在何处?m座煤矿开采的原煤应如何分配给两个发电厂,才能使每年的总费用(发电厂运行费用与原煤费用之和)为最小。
输入
第1行: m b h n
第2行: a1 a2 … am (0<=ai<=500,a1+a2+…+an>=b)
第3行: h1 h2 … hn (0<=hi<=100)
第4行: C10 C20 … Cm0 (0<=Cij<=50)
第5行: C11 C21 … Cm1
… …
第n+4行:C1n C2n … Cmn
输出
第1行:新厂址编号,如果有多个编号满足要求,输出最小的。
第2行:总费用
样例
factory.in
4 2 7 9
3 1 10 3
6 3 7 1 10 2 7 4 9
1 2 4 3
6 6
大约3周前 -
好吧。
之前看 算法导论 在空间复杂度那卡壳了….. 卡了很久 一直没有看懂 就没再往下看
直到半个月前。 在Matrix67神牛那里 看到了 《数据结构与算法分析》的5000字缩写.? 明白了O()、o()、Θ()、Ω()四种符号的含义 才能继续看下去
因为老师讲的超快 所以就先看 堆排序了 看一下堆和二叉树数据结构
这一章写的很有特点 就是 一步的一步 的 完成这个堆排序的各个子程序 深入浅出吧 先从 最开始的保持堆的性质 然后到 最后的堆排序 很有层次。
保持堆的性质
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
?
int i;//循环变量
int n;//数组中元素个数
int maxa;//堆中的元素个数
int temp;//临时变量
?
int printfa(int *a)//显示堆在内存中的存储状况 便于调试
{
printf("—————–Start\n");
for(i=1;i
printf("|%d |%d |\n",i,a[i]);
printf("—————–End\n");
return 0;
}
?
int parent(int i)//寻找父结点
{
return(i/2);
}
?
int left(int i)//寻找左结点
{
return(2*i);
}
?
int right(int i)//寻找右结点
{
return(2*i+1);
}
?
int max_heapify(int *a,int i)
{
int
大约1月前 -
最近关于10.04的消息传的很多 alpha 1 2 3也接连发出 就去下载了一个玩 本来是想在VMware里尝尝鲜 但是在VMware里出现了一堆问题 没法安装 换到Sun Vbox里问题竟然一样- -
看到里面有个wubi 想着用wubi装 正好我的ubuntu 9.10在升级一次后 引导坏了- – 就把9.10给删掉 直接用wubi装 可这个的引导也有问题 于是我就 重新装了一边9.10 按照官方给的
update-manager -d
升级 但是 升级途中 ?在 preparing memtest86 这一步时 终端里一直出现
Found linux image: /boot/vnlinuz-2.6.32-15-generic
的提示 按Ctrl+C忽略(我胡乱按到的 – -)
剩下一路平安到结束 但是 重启后 连win7的引导都进不去了- -
幸亏手头有张ubuntu9.10 的 live CD 恢复了win7的引导 然后吧那个升级的不知到算什么的ubuntu删了 估计是因为wubi的问题
直接用live CD硬盘装了9.10 然后update到10.04 ?这回没有问题 一路到底
重启 看到了新版的Logo~
现在在10.04下急需解决的问题是 getdeb貌似没有对10.04提供支持 songbird用不成(补救方法是 从官网下的songbird可以直接运行
大约2月前 -
前一段NOIP吧有人发了ubuntu下pascal的编程 没有C 于是我就写了一篇C的.
GUIDE版(anjuta的过一段再写~)
一、GUIDE
先去官方网站下载GUIDE http://gait.buaa.edu.cn/~zjb/ 下载ubuntu版 然后打开shell 进入tar包所在的目录 依次执行(需要注意的是 大小写!大小写一定要正确)
$tar xvf GUIDE-1.0.1-ubuntu.tar
$sudo -s
#./install.sh
shell出现Please select install path for GUIDE(default path is /usr/bin): 时
输入
/usr/bin
出现Install finished!
时 安装成功。
不过这里需要说一下 按照官方给的方式安装完之后 在应用程序里没有找到GUIDE(不知道NOI LINUX是怎么弄上去的- -) 我的解决办法是在shell里直接执行GUIDE 不过这样的话这个shell就不能干其他了(谁有更好的解决办法)
打开GUIDE
会出现下面的窗口
ubuntu默认只带了c的编译器 不过我们还是给其他两个都装上把
在shell里 执行(需要联网):
sudo apt-get install g++
sudo apt-get install fp-compiler
安装完后 点一下 Test 按钮 都变成了对钩 点OK进入主界面
新建一个文件(主要说C)
比如我这样写
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
?
int main()
{
int a=4;
char b[99],c[99];
scanf("%s",b);
strcpy(c,b);
a=sqrt(a);
printf("Hello GUIDE! %d %s",a,c);
system("gcc –version");
return 0;
}
(这样是为了上面那些库里都至少涉及一个函数)
但是按F7编译时却出现了问题 undefined
大约2月前 -
亲爱的朋友们 还记得我3个月前说的 要写POJ解题报告的事么? 不好意思我跳票了 实际上是一个问题一直没有解决 而且是一个超级简单的题目 终于在刚刚 Accepted 了!!
在此 需要感谢下alex的指导
先不多说 上代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
?
int main()
{
int yi,wu,shi;yi=0;wu=0;shi=0;
int i;
int n,a;
fscanf(stdin,"%d",&n);
for(i=0;i<n;i++)
{
fscanf(stdin,"%d",&a);
switch(a)
{
case 1: yi++;break;
case 5: wu++;break;
case 10: shi++;break;
}
}
printf("%d\n%d\n%d",yi,wu,shi);
return(1);
}
需要说一下的是
stdin的应用 这源自alex给我的指导 stdin的用途就是把键盘输入的转化成流 基本等同于fopen一个文件后的结果 所以在fscanf的位置上也等同了
这一道题主要是解决多行输入以及第二行输入数目可变的问题
在此感谢alex同学的帮助~~!
顺便: 新年快乐!~~
大约2月前 -
囧….历尽千辛万苦 终于把本本折腾成了ubuntu 等会再说艰辛把…
换上了ubuntu 那就一定要感受下vim啦 居士在之前那个vim系列都看得我心里痒痒..想去玩玩vim (话说最近居士跑到那里了 N久不见更新了 最后一篇是总结 好奇怪阿好奇怪)
$sudo apt-get install vim-full
安装完就好了 像居士那样 使用gvim 用vim就一定要show下.vimrc拉
直接贴了 老规矩 “后是注释
set nocompatible
“取消兼容模式(这句到底是干什么的我也没明白)
set number
“激活行号
set backspace=indent,eol,start
“在插入模式下可以删除最前面的空格
filetype on
“自动检测文件类型
syntax on
“代码高亮
set autoindent
set smartindent
“以上两句是打开自动继承上一行格式
set guioptions-=T
“关闭上面的toolbar
set showmatch
“自动匹配括号(就是写C程的时候 那个大括号自动匹配)
set vb t_vb=
“右下角显示状态行
set ruler
“显示光标所在行列
set incsearch
“开启智能搜索
colo bensday
“开启bensday主题 (这里不得不推荐一个网站 有N种配色方案 自己来挑自己喜欢的吧 传送门
set guifont=Bitstream\ Vera\ Sans\ Mono
“设定字体为Bitsteam Vera Sans Mono(貌似是因为那个配色方案带的字体把 不太好看 自己自定义一下 TIPS:如果字体里含有空格 在空格前面加上\就行)