Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main()
- {
- long long S=0,n,i;
- cin>>n;
- for (i=1;i<=sqrt(n);i++)
- if (n%i==0)
- {
- S+=i;
- if (n/i>i)
- S+=n/i;
- }
- cout << S;
- return 0;
- }
- #include <fstream>
- using namespace std;
- int main ()
- {
- ifstream fin ("data.in");
- ofstream fout("data.out");
- int n1,n2,i,j,v[102],w[102],s[104],n,aux=0;
- fin>>n1;
- for (i=1;i<=n1;i++)
- fin>>v[i];
- fin>>n2;
- for (j=1;j<=n2;j++)
- fin>>w[j];
- n=(n1>n2)?n1:n2;
- i=n;
- while (i)
- {
- s[i]=v[i]+w[i]+aux;;
- aux=0;
- if (s[i]/10&&i!=1)
- {
- aux=1;
- s[i]%=10;
- }
- i--;
- }
- for (i=1;i<=n;i++)
- fout<<s[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement