update
This commit is contained in:
parent
39c9114206
commit
06af1b4c52
7
20240823/十四届蓝桥比赛/数独填数.cpp
Normal file
7
20240823/十四届蓝桥比赛/数独填数.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
}
|
34
20240823/十四届蓝桥比赛/简单算术题.cpp
Normal file
34
20240823/十四届蓝桥比赛/简单算术题.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
typedef long long ll;
|
||||
|
||||
stack<ll> s;
|
||||
|
||||
int main(){
|
||||
int i;
|
||||
cin>>i;
|
||||
char f;
|
||||
s.push(i);
|
||||
while(cin>>f){
|
||||
cin>>i;
|
||||
if(f=='+'){
|
||||
s.push(i);
|
||||
}else if(f=='-'){
|
||||
s.push(-i);
|
||||
}else if(f=='*'){
|
||||
int h = s.top();
|
||||
s.pop();
|
||||
s.push(h*i);
|
||||
}else{
|
||||
int h = s.top();
|
||||
s.pop();
|
||||
s.push(h/i);
|
||||
}
|
||||
}
|
||||
int ans = 0;
|
||||
while(s.empty()==false){
|
||||
ans+=s.top();
|
||||
s.pop();
|
||||
}
|
||||
cout<<ans<<endl;
|
||||
}
|
@ -12,4 +12,10 @@ target("lq148jz")
|
||||
add_files("20240823/十四届蓝桥比赛/八进制回文平方数.cpp")
|
||||
|
||||
target("lq14zy")
|
||||
add_files("20240823/十四届蓝桥比赛/主要成分.cpp")
|
||||
add_files("20240823/十四届蓝桥比赛/主要成分.cpp")
|
||||
|
||||
target("lq14jd")
|
||||
add_files("20240823/十四届蓝桥比赛/简单算术题.cpp")
|
||||
|
||||
target("lq14sd")
|
||||
add_files("20240823/十四届蓝桥比赛/数独填数.cpp")
|
Loading…
Reference in New Issue
Block a user