Ajutor Sir de caractere

Intrebari despre limbajul C++, standardul C++, STL, OOP in C++ sau alte subiecte nelegate de VisualC++
Post Reply
Skkyper
Junior
Junior
Posts: 2
Joined: 09 Nov 2014, 21:30
Judet: Bihor

Ajutor Sir de caractere

Post by Skkyper » 09 Nov 2014, 21:37

Buna, am 2 probleme de facut in biblioteca <stdio.h> si <string.h> dar fiind incepator nu le stiu face .

1. Se citeste un text de la tastatura . Eliminati cifrele din text inlocuindu-le cu litera corespunzatoare din alfabet .
2. Se da un nr. x, convertiti-l intru-un sir de caractere corespunzator .

As dori o explicatie sau o rezolvare cat mai simpla, sa le inteleg.



atty97
Junior
Junior
Posts: 5
Joined: 15 Jul 2012, 15:39
Judet: Cluj

Re: Ajutor Sir de caractere

Post by atty97 » 12 Nov 2014, 02:44

Poti descrie cele doua probleme mai detaliat?

User avatar
MarianMMX
Junior
Junior
Posts: 16
Joined: 27 Mar 2014, 09:50
Judet: Galaţi

Re: Ajutor Sir de caractere

Post by MarianMMX » 13 Nov 2014, 11:50

Skkyper wrote:1. Se citeste un text de la tastatura . Eliminati cifrele din text inlocuindu-le cu litera corespunzatoare din alfabet .
Despre ce alfabel e vorba?
Skkyper wrote:2. Se da un nr. x, convertiti-l intru-un sir de caractere corespunzator .
C

Code: Select all

int numarX = 12345678;
char sirCaractere[100];
sprintf ( sirCaractere, "%d", numarX );
C++

Code: Select all

int numarX = 12345678;
std::string sirCaractere = std::to_string(numarX);
If you think C++ is not overly complicated, just what is a
protected abstract virtual base pure virtual private destructor
and when was the last time you needed one? — Tom Cargill (1990)

User avatar
black_atus
Membru
Membru
Posts: 139
Joined: 20 Jun 2012, 10:20
Judet: Prahova
Location: Ploiesti

Re: Ajutor Sir de caractere

Post by black_atus » 13 Nov 2014, 16:41

Cred ca vrea ca in locul cifrei 1 sa apara litera A..Nu stiu..Nu e deloc explicit..
Cu stima,
Daniel Constantin

Skkyper
Junior
Junior
Posts: 2
Joined: 09 Nov 2014, 21:30
Judet: Bihor

Re: Ajutor Sir de caractere

Post by Skkyper » 13 Nov 2014, 22:20

Scuzati modul in care sunt explicate enunturile problemei , asa le-am primit de la profesor ...

Post Reply