Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int num, t, s;
- t = 0;
- s = 0;
- while(scanf("%d",&num)!=EOF){
- t++;
- if (num % t == 0){
- s += t;
- }
- if (s == num){
- printf("%d perfect",s);
- }
- else if ((s - num < 2 ) || (s - num > -2)){
- printf("%d almost perfect",s);
- }
- else {
- printf("%d not perfect",s);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement