User
Pass
2FA
 
 

Informatica

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Homework zone
Author Message1338
Valentin001

[Mentally Stable]



Status: Offline
(since 14-01-2018 16: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: Offline
(since 01-02-2020 14:06)
Joined: 11 Sep 2012
Posts: 2565, Topics: 193
Location: Bucuresti

Reputation: 363.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 16: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
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Freakz Forum Index -> Trash Bin -> Trash -> Homework zone  


The time now is 28-03-2024, 16:21:06
Copyright info

Based on phpBB ro/com
B

 
 
 







I forgot my password


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