Jump to content

[C++] SAMP Levels & Hours Calculator


SkiizO
 Share

Recommended Posts

Nivel: incepator

Timp de lucru: 10 minute

Este un program simplu.

 

2hgwbkj.png

Link de scanare online impotriva virusilor

 

Programul il puteti descarca de aici: www.girlshare.ro/2697785.2

 

Sursa (pentru programatori):

#include<iostream>
#include<conio.h>
using namespace std;

char choose,i;
int ore=0,level=0,ok=0;

int choosea() {
system("cls");
	cout<<"Cate ore jucate ai?"<<endl;
	cin>>ore;
	level=ore/4;
	cout<<"La "<<ore<<" ore ai level "<<level<<"!";
	return 0;
}
int chooseb() {
system("cls");
	cout<<"Level?"<<endl;
	cin>>level;
	ore=level*4;
	cout<<"La level "<<level<<" ai nevoie de "<<ore<<" ore!";
	return 0;
}

int main() {

cout<<"Alege o varianta:"<<endl<<endl<<"a. pentru a calcula ce level ai dupa orele jucate scrie 'a'"<<endl<<"b. pentru a calcula cate ore iti trebuie sa faci un level scrie 'b'"<<endl<<"Raspuns: ";
cin>>choose;

if(choose=='a') {
	choosea();
}

if(choose=='b') {
	chooseb();
}


_getch();
}
 

 

Program lucrat de mine in MSV 10

Edited by eB Teodor
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.