[ create a new paste ] login | about

Link: http://codepad.org/Tv3zSTP7    [ raw code | output | fork ]

C++, pasted on Aug 6:
#include <iostream>
#include <vector> 
#include <cstring>
using namespace std;
int main()
{   int i=0,a=0;
  string n[i];
 while (true)
{ cin>>n[i];
    a+=1;
      if ( n[i]=="0:00" )
        { a-=1;
            break;  } 
    i++;
}
 while (i<a)
    { if ( n[i]== "1:00"||n[i]=="11:00")
        {  cout<<"30.000"<<endl; }
      else if (n[i]=="2:00"||n[i]=="10:00")
        { cout<<"60.000"<<endl; }
      else if (n[i]=="3:00"||n[i]=="9:00")
        { cout<<"90.000"<<endl; }
      else if (n[i]=="4:00"||n[i]=="8:00")
        { cout<<"120.000"<<endl; }
      else if (n[i]=="5:00"||n[i]=="7:00")
        { cout<<"150.000"<<endl; }
      else if (n[i]=="6:00")
        { cout<<"180.000"<<endl; }
      else if (n[i]=="12:00")
        { cout<<"0.000"<<endl; }
            }
return 0; }


Output:
1
2
3
In function 'int main()':
Line 7: error: ISO C++ forbids variable-size array 'n'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: