Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main () {
- int vnesenbroj,vtorbrojach,brojach,zbir,kraenzbir=0,promenlivazapechatenje;
- scanf("%d", &vnesenbroj);
- brojach=vnesenbroj-1;
- while(brojach) {
- zbir=0;
- for(vtorbrojach=1; vtorbrojach<brojach; vtorbrojach++) {
- if(brojach%vtorbrojach==0) {
- zbir+=vtorbrojach;
- }
- }
- if(zbir>kraenzbir) {
- promenlivazapechatenje=brojach;
- kraenzbir=zbir;
- }
- brojach--;
- }
- printf("%d",promenlivazapechatenje);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement