fork download
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3. #define taskname "phuongtrinhbacnhat"
  4. using namespace std;
  5. double a,b,x;
  6.  
  7. void nhap(){
  8. cin>>a>>b;
  9. }
  10. void giai(){
  11. if (a==0 && b!=0){
  12. cout<<"nosolution";
  13. }
  14. else if(b==0){
  15. cout<<"infinitesolution";
  16. }
  17. else {
  18. x=-b / a;
  19. cout<<x;
  20. }
  21. }
  22. int main() {
  23. if(fopen(taskname".inp","r")){
  24. freopen(taskname".inp","r",stdin);
  25. freopen(taskname".out","w",stdout);
  26. }
  27. nhap();
  28. giai();
  29. return 0;
  30. }
Success #stdin #stdout 0s 5316KB
stdin
0 5

stdout
nosolution