![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程问题总结
此杭非彼航
凡是过往,皆为序章
展开
-
Devc++ 报错[Error] ld returned 1 exit status,我来说一种解决方案
问题先看代码int a[30001][30001],visited[30001],count=0;这时点击编译就会报错解决方案出现这样的问题是因为数组过大,64位也无法容纳,所以我们将数组调小即可原创 2021-04-09 13:17:21 · 742 阅读 · 1 评论 -
PTA使用{0}的方式初始化数组(C语言),出现编译错误的解决方法
问题说明在PTA中初始化数组时(C语言),如果采用的是下面这种方式:int a[10]={0};就一定要注意选择好语言解决方案我们一定要在上面的框中一定要选择C++(g++)这一项,这样至少能保证编译不出错;而如果选择了C(gcc),C(clang),C++(clang++)这三项,则会直接显示编译错误...原创 2021-03-27 13:29:59 · 723 阅读 · 0 评论 -
编程问题总结——while循环变量自增(分类统计各类字符字数)
背景做这道题时,用while循环遍历字符数组时忘了将循环变量自增导致系统提示运行超时答案void StringCount( char *s ) //大写字母个数 小写字母个数 空格个数 数字个数 其它字符个数{ int i=0,a=0,b=0,c=0,d=0,e=0; while(s[i]!='\0') { if(s[i]>='A'&&s[i]<='Z') a++; else if(s[i]>='a'&&s[i]<='z')原创 2021-03-10 21:01:43 · 573 阅读 · 0 评论 -
编程问题总结——[Error] ‘pow‘ was not declared in this scope
问题描述:编译代码时系统报错:[Error] ‘pow’ was not declared in this scope代码如下:#include <stdio.h>double fn( double x, int n );int main(){ double x; int n; scanf("%lf %d", &x, &n); printf("%lf",pow(x,n));// printf("%.2f\n", fn(x,n原创 2021-03-08 15:07:31 · 7663 阅读 · 5 评论