Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n,a,suma_dziel;
- cin>>n;
- for(int i=0;i<n;i++)
- {
- cin>>a;
- suma_dziel=0;
- for(int j=1;j<a;j++)
- {
- if(a%j==0)
- {
- suma_dziel+=j;
- }
- }
- if(suma_dziel==a)
- {
- cout<<"Jest to liczba doskonala"<<endl;
- }
- if(suma_dziel<a)
- {
- cout<<"Jest to liczba nadmiarowa"<<endl;
- }
- if(suma_dziel>a)
- {
- cout<<"Jest to liczba deficytowa"<<endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement