Jump to content

Recommended Posts

Posted

Se considera un numar natural (n>1000).Sa se afiseze cele doua numere formate din "injumatatirea" scrierii zecimale a lui n. 

Ex : Pentru n=12345 se va afisa 12 si 345. Pentru 182345 se va afisa 182 si 345

 

Are cineva vreo idee ?

  • 2 weeks later...

Posted

Eu zic ca primul lucru e sa afli de cate cifre e numarul,il imparti la 10,pana cand numarul va fi 0

n2=n;//poate o sa mai ai nevoie de n.

nr=0

while(n2!=0)

{n2=n2/10;

nr++}

Sper ca te-a ajutat,chestiile declarative le poti face tu..

  • gaby changed the title to Afisare doua numere prin injumatatire (C++)?

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.