delete pics to save space
This commit is contained in:
24
history_source/ccf 入门篇/U5/5.4.3.cpp
Normal file
24
history_source/ccf 入门篇/U5/5.4.3.cpp
Normal file
@ -0,0 +1,24 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
char sr;
|
||||
long long ans,an;
|
||||
while(true)
|
||||
{
|
||||
ans=0;
|
||||
an=0;
|
||||
while(true)
|
||||
{
|
||||
sr=getchar();
|
||||
if(sr=='\n') break;
|
||||
if(sr=='+') {
|
||||
ans+=an;
|
||||
an=0;
|
||||
}
|
||||
else an=an*10+sr-'0';
|
||||
}
|
||||
ans+=an;
|
||||
cout<<ans<<endl;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user