|
|
|
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)); - это типа выфделение памяти? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.04.2007, 23:16 |
|
||
|
stdlib и conio
|
|||
|---|---|---|---|
|
#18+
для ф-и calloc нужен stdlib.h про это пишет хелп по этой ф-и Код: plaintext 1. 2. 3. 4. Код: plaintext 1. 2. 3. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 15.04.2007, 01:11 |
|
||
|
|

start [/forum/topic.php?fid=57&tid=2029044]: |
0ms |
get settings: |
8ms |
get forum list: |
18ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
173ms |
get topic data: |
8ms |
get forum data: |
2ms |
get page messages: |
31ms |
get tp. blocked users: |
1ms |
| others: | 217ms |
| total: | 464ms |

| 0 / 0 |
