Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
4224 罗炜翰 数1的个数 C++ Wrong Answer 0 0 MS 256 KB 491 2025-01-05 16:54:47

Tests(0/5):


#include<iostream> #include<iomanip> using namespace std; int main() { int n,a,g,s; cin>>n; for (int i = 1;i <= n;i ++) { s = i; do{ if (s % 10 == 1) { a++; } s /= 10; }while(s != 0); } cout<<a; } /*#include<iostream> using namespace std; int main() { int x,n,i,j; cin>>x>>n; for (i = 1;i < n;i++) { if (x != 6 || x != 7) { j += 1; } if (x == 7) { x = 1; } x += 1; } cout<<j * (100 + 150); }*/


Judgement Protocol: