
Новые сообщения [новые:0]
Дайджест
Горячие темы
Избранное [новые:0]
Форумы
Пользователи
Статистика
Статистика нагрузки
Мод. лог
Поиск
|
|
14.04.2007, 23:16
|
|||
|---|---|---|---|
|
|||
stdlib и conio |
|||
|
#18+
#include<iostream.h> #include<stdlib.h> #include<conio.h> int *b,i,n,*d,j,ch,*B; int* prog(int *b,int n) { int first,fi,li,elem; first=0; for (i=0;i<n;i++) {if (first==0 && b <0) {first=1; fi=i;} if (first==1 && b<0) li=i;} elem=b[fi]; b[fi]=b; b =elem; return b;} int main(){ clrscr(); while (ch!=2) {cout<<"1 - ђҐиЁвм § ¤ зг"<<endl; cout<<"2 - ‚л©вЁ"<<endl; cin>>ch; if (ch==1) {cout<<"‚ўҐ¤ЁвҐ зЁб«® н«Ґ¬Ґв®ў ¬ ббЁў \n"; cin>>n; b=(int *)calloc(n,sizeof(int)); cout<<"‚ў®¤ЁвҐ ¬ ббЁў\n"; for (i=0;i<n;i++) cin>>b; cout<<endl; B=prog(b,n); for (j=0;j<n;j++) cout<<B[j]<<endl; free(b);} } return 0;} хотел спросить, за что в этой лабе отвечают библиотеки #include<stdlib.h> и #include<conio.h>. И еще b=(int *)calloc(n,sizeof(int)); - это типа выфделение памяти? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|
15.04.2007, 01:11
|
|||
|---|---|---|---|
stdlib и conio |
|||
|
#18+
для ф-и calloc нужен stdlib.h про это пишет хелп по этой ф-и Код: plaintext 1. 2. 3. 4. Код: plaintext 1. 2. 3. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
|
|
|

start [/forum/topic.php?fid=57&mobile=1&tid=2029044]: |
0ms |
get settings: |
6ms |
get forum list: |
26ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
45ms |
get topic data: |
15ms |
get forum data: |
5ms |
get page messages: |
59ms |
get tp. blocked users: |
1ms |
| others: | 247ms |
| total: | 408ms |

| 0 / 0 |
