竞赛讨论区 > 请教问题在哪里??
头像
牛客890869513号
发布于 2020-06-12 11:25
+ 关注

请教问题在哪里??

#include <iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int a,b;
    for (int i=1;i<=n;i++)
    {
      if (i%3==0)
      {
          a=i;
          while(a!=0)
          {
              b=a%10;
              if(b==5)
              {
                  cout<<i<<endl;
              }
              a=a/10;
          }
      }
    }

    return 0;
}

链接:https://ac.nowcoder.com/acm/problem/22189
来源:牛客网
3和5
返回全部题目

列表加载中...
C++11(clang++ 3.9)
重置自测
xxxxxxxxxx
1
#include <iostream>
2
using namespace std;
3
int main()
4
{
5
 int n;
6
 cin>>n;
7
 int a,b;
8
 for (int i=1;i<=n;i++)
9
 {
10
 if (i%3==0)
11
 {
12
 a=i;
13
 while(a!=0)
14
 {
15
 b=a%10;
16
 if(b==5)
17
 {
18
  cout<<i<<endl;
19
 }
20
 a=a/10;
21
 }
22
 }
23
 }
24
25
 return 0;
26
}
27
不通过
您的代码已保存
答案错误:您提交的程序没有通过所有的测试用例
case通过率为0.00%

全部评论

(1) 回帖
加载中...
话题 回帖

本文相关内容

等你来战

查看全部

热门推荐