Cod sursa(job #1906177)
| Utilizator | Data | 6 martie 2017 12:38:37 | |
|---|---|---|---|
| Problema | Algoritmul lui Euclid | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.41 kb |
// stold example
#include <iostream> // std::cout
#include <string> // std::string, std::stod
int main ()
{
std::string orbits ("90613.305 365.24");
std::string::size_type sz; // alias of size_t
long double pluto = std::stoi (orbits,&sz);
long double earth = std::stoi (orbits.substr(sz));
std::cout << "Pluto takes " << (pluto/earth) << " years to complete an orbit.\n";
return 0;
}
