Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include "lock.h"
  4. #define OUTP freopen("output.txt","w",stdout)
  5.  
  6. using namespace std;
  7. string a,b;
  8. int arr[100001];
  9.  
  10.  
  11. void AddDigit(int f,int s){
  12. a+=(char)(f+'0');
  13. b+=(char)(s+'0');
  14. }
  15.  
  16. int Question(int p){
  17. for(int i(0); i < 1500;i++)arr[i] = 0;
  18. int pnt = 0;
  19. for(int i(a.size()-1); i>=0;i--){
  20. int fst = (int)(a[i]-'0');
  21. int snd = (int)(b[i]-'0');
  22. arr[pnt]+= (fst+snd);
  23. if(arr[pnt]>=10){
  24. arr[pnt+1]++;
  25. arr[pnt]-=10;
  26. }
  27. pnt++;
  28. }
  29. int q = arr[p-1];
  30. return q;
  31. }
  32.  
  33. void DelDigits(int p){
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement