Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 12.07.2002, 20:07   #1
4294967296
 
Boyov's Avatar
 
Join Date: 03 2002
Location: /proc/1
Age: 33
Posts: 379
Downloads: 4
Uploads: 0
Reputation: 0 | 0
Post ASCII code in c++

Lyudi kak mojno C++ um smailik( ) "cout" anel, tipa es ira ASCII cod@ gidem bayc te vonc ogtagortsem chgidem .

10x in advance
Reply With Quote
Old 12.07.2002, 20:11   #2
»
 
z0mbie's Avatar
 
Join Date: 01 2002
Posts: 777
Downloads: 1
Uploads: 0
Reputation: 0 | 0
Post

Code:
cout<<(char)2;
ili
printf(&quot;%c&quot;,2);
Reply With Quote
Old 13.07.2002, 00:13   #3
The Reloaded
 
Aram Hambardzumyan's Avatar
 
Join Date: 01 2002
Location: behind the flesh and gelatinе of soft dull eyes
Posts: 3,387
Downloads: 4
Uploads: 0
Reputation: 146 | 4
Post

еще код символа можно задать с помощью escape-последовательности (последовательность, начинающаяся с '\'): '\ddd', где ddd - код данного символа (не помню, разрешены только восмиричные цифры или все)
Reply With Quote
Old 13.07.2002, 05:47   #4
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Quote:
Originally posted by Aram Hambardzumyan:
еще код символа можно задать с помощью escape-последовательности (последовательность, начинающаяся с '\'): '\ddd', где ddd - код данного символа (не помню, разрешены только восмиричные цифры или все)
\ooo - octal code
\xhhh - hexadecimal code.
Reply With Quote
Old 18.07.2002, 04:34   #5
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Joxovurd isk vonc kareli a rand() funkcianan sahmanov ogtagorcel.Aysinqn es uzum em minchev 50-@ random tiv @ntri voch te 10232 kam 28472 ev ayln...
Reply With Quote
Old 18.07.2002, 04:40   #6
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

rand( ) % N
Sa kta qez random tver 0-ic minchev N-1.
Reply With Quote
Old 18.07.2002, 04:43   #7
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

2 Eddi
es gitei vor nman bana bayc shat@ porcum ei
rand()*N qani vor QBASIC-um RND*N-a
Reply With Quote
Old 18.07.2002, 04:45   #8
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

2 Eddi
es gitei vor nman bana bayc shat@ porcum ei
rand()*N qani vor QBASIC-um RND*N-a
mersi
Reply With Quote
Old 18.07.2002, 05:10   #9
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Sorry 2 hat el harc
1) vonc anem vor 0-ic n-1 chani ay m-ic n-1 ?
2)amen angam cragir@ ashxatacneluc nuyn dzevi a random anum tver@ ...vonc anem vor asenk RANDOMIZE TIMER -i nman ban anem vor amen angam tarber tver random ta ?
Reply With Quote
Old 18.07.2002, 05:28   #10
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

Code:
#include <timer.h>


.....

// Cragri skzbum mi tekh
srand( time( NULL ) );

.....

nRandomNumber = m + rand( ) % ( n - m );
Sorryn antekhi a Forumy harceri hamara!
Have fun!
Reply With Quote
Old 18.07.2002, 05:34   #11
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

chi linum ...
n-m@
asenk grum em
a=rand()%(90-40) chi linum hasanum a
90-40=50 u rand()%50
Reply With Quote
Old 18.07.2002, 05:41   #12
Студент
 
Join Date: 06 2002
Location: Yerevan
Posts: 258
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

40 + rand()%(90-40)
Reply With Quote
Old 18.07.2002, 05:42   #13
Студент
 
Join Date: 05 2002
Location: Armenia
Posts: 276
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Post

OK chishta mersi
vonc chei faymum
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 15:00.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.