标题:HDOJ 2017 题 题目见正文
取消只看楼主
Ljldym
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2015-5-9
结帖率:57.14%
已结贴  问题点数:2 回复次数:0 
HDOJ 2017 题 题目见正文

提交之后显示Runtime Error
(ACCESS_VIOLATION)      求助!
#include"iostream"
using namespace std;
int main()
{
    int n,count;
    while (cin >> n)
    {
        fflush(stdin);
        count = 0;
        char **p;
        p = (char **)calloc(n, sizeof(char));
        for (int i = 0; i < n; i++)
            p[i] = (char *)calloc(100, sizeof(char));
        for (int i = 0; i < n; i++)
        {
            gets(p[i]);
            fflush(stdin);
        }
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; p[i][j] != '\0'; j++)
            {
                if (p[i][j] >= '0' && p[i][j] <= '9')
                    count++;
            }
            cout << count << endl;
            count = 0;
        }
    }
}
搜索更多相关主题的帖子: include count 
2016-03-08 19:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-462265-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.501403 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved