bai tap thuc hanh

View previous topic View next topic Go down

bai tap thuc hanh

Post by sallowery on 2010-03-25, 9:03 am

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
void nhap(int a[], int &n)
{

srand(clock());
for(int i=0;i<n;i++)
{
printf("\nnhap phan tu a[%d]",i);

a[i]=rand()%100;
}
}
void xuat(int a[], int n)
{
for(int i=0;i<n;i++)
{
printf("%10d", a[i]);

}
}
// r;read
//t:text

void luu(char*ten, int a[], int &n)
{
FILE*f=fopen(ten,"wt");
if(f!=0)//mo file thanh cong
{
fprintf(f," %d ",&n);

for(int i=0;i<n;i++)
{
fprintf(f," %d ",a[i]);
}
}
fclose(f);
}
void main(int t,char*argv[])
{
int c=atoi(argv[1]);
int b=atoi(argv[2]);
int s=b+c;
printf("%d",s);

}
Smile Smile

sallowery
Đã biết nói
Đã biết nói

Tổng số bài gửi : 21
Join date : 2009-10-25
Age : 25
Đến từ : Củ Chi

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum