Salut! :))
Prima varianta:
#include <iostream>
using namespace std;
int n;
int main()
{
cin>>n;
if(n==1)
cout<<"luni";
else
if(n==2)
cout<<"marti";
else
if(n==3)
cout<<"miercuri";
else
if(n==4)
cout<<"joi";
else
if(n==5)
cout<<"vineri";
else
if(n==6)
cout<<"sambata";
else
cout<<"duminica";
return 0;
}
A doua varianta:
#include <iostream>
using namespace std;
int n;
int main()
{
cin>>n;
switch(n)
{
case 1: cout<<"luni"; break;
case 2: cout<<"marti"; break;
case 3: cout<<"miercuri"; break;
case 4: cout<<"joi"; break;
case 5: cout<<"vineri"; break;
case 6: cout<<"sambata"; break;
case 7: cout<<"duminica"; break;
}
return 0;
}
A doua varianta este mai rapida decat prima.
Succes!