Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream in("reteta.in");
- ofstream out("reteta.out");
- char s[5001];
- int cnt;
- int verifica(char a[], int q)
- {
- while(s[q]==' ')
- {
- q++;
- }
- if(isdigit(s[q]))
- {
- int z=s[q]-'0';
- q++;
- while(isdigit(s[q]))
- {
- z*=10;
- z= z + (s[q]-'0');
- q++;
- }
- return z;
- }
- return 0;
- }
- char incrediente[256][256];
- int su=0;
- int main()
- {
- in.getline(s,256);
- for(int i=0;i<strlen(s);i++)
- {
- if(s[i]==')')
- {
- su+=verifica(s, i+1);
- }
- }
- out<<su;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement