Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void) {
- int n, i, c , soma , j;
- printf("Digite: ");
- scanf("%d", &n);
- int v[n];
- for(j=4; j<=n; j++){
- c=0, soma = 0;
- for(i=1; i<j; i++){
- if(j%i==0){
- v[c] = i;
- c++;
- }
- }
- for(i=0; i<c; i++){
- soma+=v[i];
- }
- if(soma==j){
- printf(" %d", j);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement