Advertisement
Saleh127

Live ar 3997

Aug 16th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. ios_base::sync_with_stdio(0);
  6. cin.tie(0);cout.tie(0);
  7.  
  8. int c,d,e,i,j,t;
  9. string a;
  10. cin>>t;
  11. while(t--)
  12. {
  13. cin>>c>>a;
  14. d=a.size();
  15. e=0;
  16. for(i=0;i<d;i++)
  17. {
  18. e=(e*10+a[i]-'0')%c;
  19. }
  20. cout<<e<<endl;
  21.  
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement