Submission #3837445
Source Code Expand
#include <iostream>
using namespace std;
int main(){
int N;
cin >> N;
int ans = 0;
while(N > 0){
if(N % 10 == 2) ans++;
N /= 10;
}
cout << ans << endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 12/22 |
| User | lawel3110 |
| Language | C++14 (GCC 5.4.1) |
| Score | 100 |
| Code Size | 208 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 256 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | sample1.txt, sample2.txt, sample3.txt |
| All | sample1.txt, sample2.txt, sample3.txt, 1.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, sample1.txt, sample2.txt, sample3.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 1.txt | AC | 1 ms | 256 KiB |
| 2.txt | AC | 1 ms | 256 KiB |
| 3.txt | AC | 1 ms | 256 KiB |
| 4.txt | AC | 1 ms | 256 KiB |
| 5.txt | AC | 1 ms | 256 KiB |
| 6.txt | AC | 1 ms | 256 KiB |
| 7.txt | AC | 1 ms | 256 KiB |
| sample1.txt | AC | 1 ms | 256 KiB |
| sample2.txt | AC | 1 ms | 256 KiB |
| sample3.txt | AC | 1 ms | 256 KiB |