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