当前位置:网站首页>Sum of CCF digits (full mark code + problem solving idea) 201512-1
Sum of CCF digits (full mark code + problem solving idea) 201512-1
2022-06-30 14:41:00 【A cute little monkey】
Title Description

Their thinking
Treat long numbers as strings string Input , Every bit in the array Character to number Conduct Sum by accumulation
Code implementation
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
string a;
cin >> a;
int res = 0;
for (int i = 0; i < a.size(); i ++)
{
res += a[i] - '0';
}
cout << res;
return 0;
}
边栏推荐
- org. json. The jsonobject object is converted to JSON, and JSON adds new elements. The value is obtained according to the JSON key. And list object format string to jsonarray
- Vue returns to the previous page without refreshing the page / Vue caches the page
- An error is reported when installing dataspherestudio doc: invalid default value for 'update_ time‘
- PHP generate images into Base64
- PS dynamic drawing
- [extensive reading of papers] multi modal sarcasm detection and human classification in code mixed conversations
- @Component use cases
- Zend studio how to import an existing project
- 【BUUCTF】[GXYCTF2019]Ping Ping Ping1
- Detailed explanation of settimeout() and setinterval()
猜你喜欢

Knowledge learned from the water resources institute project

The first three passes of sqli Labs

V3 03_ Getting started

JS to realize simple lottery function

Not satisfied with markdown native code block style? Try this beautify code screenshot tool~~

val_ Loss decreases first and then increases or does not decrease but only increases

Laravel upload error

Crypto questions

Lihongyi machine learning 2020 homework summary

Error $(...) size is not a function
随机推荐
Use of laravel repository mode
ThinkPHP show method parameter controllable command execution
[extensive reading of papers] attributes guided facial image completion
Add attributes to multimode
PS cutting height 1px, Y-axis tiling background image problem
数据恢复软件EasyRecovery15下载
JS delete the objects in the array and specify to delete the objects
Cost forecast of PMP (BAC, EAC, etc)
PHP 2D array change key name
DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703
Basic learning notes of C language
PS tip: the video frame to Layer command cannot be completed because dynamiclink is not available
Error on datetime when importing SQL file from MySQL
Lfi-rce without controllable documents
2021-07-15Caused by: org. quartz. ObjectAlreadyExistsException: Unable to store Job : ‘DEFAULT. TASK_ 1‘
August 24, 2021 deque queue and stack
Laravel RBAC laravel permission use
Go common lock mutex and rwmutex
Querywrapper in mybaits plus
The kth largest element in the sorted array