Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <cmath>
- void Unos(double n)
- {
- for(;;)
- {
- std::cin>>n;
- if(std::cin) break;
- std::cout<<"Pogresan unos!\n";
- std::cin.clear();
- std::cin.ignore(1000, '\n');
- }
- }
- double Rjesenje(double &a, double &b, double &c)
- {
- return (-b+sqrt(4*a*c+b*b))/2;
- }
- int main()
- {
- double a, b,c;
- std::cout<<"Unesite koeficijent a: ";
- if(Unos(a)==0)
- std::cout<<"Pogresan unos!"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement