User
Pass
2FA
 
 

Informatica

 
Post new topic   Reply to topic    Freakz Forum Index -> Omul si societatea, arta si cultura, timpul liber -> School & Education -> Homework zone
Author Message784
Valentin001

[Mentally Stable]



Status: Offline
(since 14-01-2018 17:00)
Joined: 14 Jan 2018
Posts: 2, Topics: 1
Location: Romania

Reputation: 1.1

Post Posted: 14-01-2018, 12:45:08 | Translate post to: ... (Click for more languages)

Sã se afiºeze toate numerele naturale mai mici sau egale cu 2000 care împãrþite la 24, 30,
18 dau restul 7.
Daca se poate, prin subprogram as vrea!
Multumesc!

0 0
  
Back to top
View user's profile Send private message
tudor1297

[shefu' la luptatori]



Status: Online!
Joined: 11 Sep 2012
Posts: 2565, Topics: 193
Location: Bucuresti

Reputation: 355.9
Votes: 250

         
Post Posted: 14-01-2018, 13:09:33 | Translate post to: ... (Click for more languages)

#include<iostream>
using namespace std;
void subprogram()
{
int i;
for(i=1; i<=2000; i++)
if(i%18==7 && i%24==7 && i%30==7)
cout<<i;
}

void main()
{
subprogram();
}




Sper ca n.am gresit nimic, n.am mai scris o linie de cod de 3 ani -

Mai exista o metoda ceva mai desteapta, si anume sa gasesti cel mai mic multiplu comun si sa afisezi multiplii nunumarului asta + 7. Adica cmmmc+7, 2*cmmmc+7 etc.
cmmmc e 360 pt 18,24,30 deci subprogramul ar deveni ceva de genul:
void subprogram()
{
int i;
for(i=0; 360*i +7 <= 2000; i++)
cout<<360*i +7;
}




[RO]Warrior Fury PvE Guide 5.4.8

[EN]Warrior Fury PvE Guide 5.4.8

0 0
  
Back to top
View user's profile Send private message Yahoo! Messenger ID
Valentin001

[Mentally Stable]



Status: Offline
(since 14-01-2018 17:00)
Joined: 14 Jan 2018
Posts: 2, Topics: 1
Location: Romania

Reputation: 1.1

Post Posted: 14-01-2018, 13:39:15 | Translate post to: ... (Click for more languages)

Multumesc de ajutor !
1 0
  
Back to top
View user's profile Send private message
Post new topic   Reply to topic    Freakz Forum Index -> Omul si societatea, arta si cultura, timpul liber -> School & Education -> Homework zone  


The time now is 15-12-2019, 11:48:57
Copyright info

Based on phpBB ro/com

 
 
 







I forgot my password


This message appears only once, so
like us now until it's too late ! :D
x