DIỄN ĐÀN CỦA LỚP 10301 ĐH SPKT TP HCM
Bạn có muốn phản ứng với tin nhắn này? Vui lòng đăng ký diễn đàn trong một vài cú nhấp chuột hoặc đăng nhập để tiếp tục.


Welcome to our forum. We hope you can find something useful. For more information please contact nhuphuzz@yahoo.com
 
Trang ChínhPortalLatest imagesTìm kiếmĐăng kýĐăng Nhập
Forum hiện không còn được cập nhật. Những tài liệu cần thiết nếu các bạn cần có thể gửi mail yêu cầu cho ad, ad sẽ cố gắng giúp cho các bạn trong khả năng có thể. Email: nhuphuzz@yahoo.com

 

 Giải bài tập Ngôn ngữ lập trình

Go down 
+2
kysikhoailang
Admin
6 posters
Tác giảThông điệp
Admin
Admin
Admin
Admin


Tổng số bài gửi : 72
Points : 15004
Reputation : 4
Join date : 18/10/2010

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime02/11/10, 03:45 pm

Mấy bài này là của giáo sư làm đó.
:lol!: :lol!:
Câu 1: viết hàm tìm số lớn nhất, nhỏ nhất trong một mảng n số nguyên

/* chuong trinh tim min max cua mang gom n phan tu n<=100 */
#include <stdio.h>
#include <conio.h>

int tmax(int a[],int n)
{ int i,max;
max=a[0];
for (i=1;i<n;i++)
if (max<a[i])
max=a[i];
return max;
}

int tmin(int a[],int n)
{ int i,min;
min=a[0];
for (i=1;i<n;i++)
if (min>a[i])
min=a[i];
return min;
}

void main (void)
{ int a[100],n,i;
/* nhap n va kiem tra n thoa man 0<n<=100 */
do
{ printf(" nhap n \n");
scanf("%d",&n);
} while ((n<=0)||(n>100));
/* nhap vao n phan tu */
for (i=0;i<n;i++)
{ printf (" nhap phan tu a[%d]= \n",i);
scanf("%d",&a[i]); }

printf(" max la: %d \n",tmax(a,n));
printf(" min la: %d \n",tmin(a,n));
getch();
}
Câu 2:
viết hàm sắp xếp tăng dần, giảm dần của một dãy cho trước

/* chuong trinh tim sap xep tang dan, giam dan cua mang gom n phan tu n<=100 */
#include <stdio.h>
#include <conio.h>
void sxtd(int a[],int n)
{ int i,j,tam;
for (i=0;i<n;i++)
for (j=i+1;j<n;j++)
if (a[i]>a[j])
{tam=a[i];
a[i]=a[j];
a[j]=tam;}
}
/*********************/
void sxgd(int a[],int n)
{ int i,j,tam;
for (i=0;i<n;i++)
for (j=i+1;j<n;j++)
if (a[i]<a[j])
{ tam=a[i];
a[i]=a[j];
a[j]=tam; }
}
/*********************/
void main (void)
{ int a[100],n,i;
/* nhap n va kiem tra n thoa man 0<n<=100 */
do
{ printf(" nhap n \n");
scanf("%d",&n);
} while ((n<=0)||(n>100));
/* nhap vao n phan tu */
for (i=0;i<n;i++)
{ printf (" nhap phan tu a[%d]= \n",i);
scanf("%d",&a[i]); }
sxtd(a,n);
printf(" day tang dan: \n");
for (i=0;i<n;i++)
printf("%d ",a[i]);
sxgd(a,n);
printf(" \n day giam dan : \n");
for (i=0;i<n;i++)
printf("%d ",a[i]);
getch();
}

Câu 3:viết hàm tách tên và họ lót từ một chuổi cho trước
#include <stdio.h>
#include <conio.h>
#include <string.h>
void tach (char s[],char ten[],char lot[])
{ int i,j,n;
n=strlen(s);
for (i=n-1;i>0;i--)
if (s[i]==' ')
break;
for (j=0;j<i;j++)
lot[j]=s[j];
lot[i]='\0';
for (j=i+1;j<n;j++)
ten[j-i-1]=s[j];
ten[n-i-1]='\0';
}
void main(void)
{ char s[30],ten[20],lot[20];
printf(" nhap ho va ten \n");
gets(s);
tach(s,ten,lot);
printf (" \n ho va chu lot: \n");
puts(lot);
printf(" ten: \n");
puts(ten);
getch();
}


Câu4: cắt bỏ các khoảng trắng
#include <stdio.h>
#include <conio.h>
#include <string.h>
void catbo( char s[])
{ int n,i,j=0;
char t[30];
n=strlen(s);
for (i=0;i<n;i++)
if (s[i]!=' ')
t[i-j]=s[i];
else j++;
t[n-j]='\0';
strcpy(s,t);
}

void main(void)
{ char s[30];
printf(" nhap chuoi: \n");
gets(s);
catbo(s);
puts(s);
getch();
}

Câu 5 và 6: viết hàm chuyển đổi 1 chuổi sang thường, sang hoa, hàm chữ đầu là hoa còn lại thường
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
void t_hoa(char s[])
{ int i,n;
n=strlen(s);
for (i=0;i<n;i++)
s[i]=toupper(s[i]);
}

void t_thuong(char s[])
{ int i,n;
n=strlen(s);
for (i=0;i<n;i++)
s[i]=tolower(s[i]);
}

void hoadd(char s[])
{ int i,n;
n=strlen(s);
s[0]=toupper(s[0]);
for (i=1;i<n;i++)
s[i]=tolower(s[i]);
}
void main(void)
{ char s[30];
printf(" nhap chuoi: \n");
gets(s);
t_hoa(s);
printf(" chuoi da doi thanh chu hoa: \n");
puts(s);
t_thuong(s);
printf(" chuoi doi thanh chu thuong: \n");
puts(s);
hoadd(s);
printf(" chuoi doi thanh chu hoa dau dong con lai thuong: \n");
puts(s);
getch();
}
--------------------------------------------------------------------------------------------
Câu 7: in chuỗi ngược

#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30],t[30];
int i,n;
printf(" nhap chuoi:\n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
t[i]=s[n-i-1];
t[n]='\0';
printf("chuoi dao nguoc: \n");
puts(t);
getch();
}
Câu 8: nhap vao chuoi dem bao nhieu chu ‘th’;
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf(" nhap chuoi \n ");
gets(s);
n=strlen(s);
for (i=0;i<n-1;i++)
if ((s[i]=='t')&&(s[i+1]=='h'))
j++;
printf("so chu 'th' co trong chuoi: %d \n",j);
getch();
}
Câu 9: nhap duong lich in ra nam am lich;
#include <stdio.h>
#include <conio.h>
void main(void)
{ int n;
printf(" nhap nam duong lich: \n");
scanf("%d",&n);
printf(" nam am lich la: \n");
switch (n%10)
{ case 0: printf(" Canh ");
break;
case 1: printf(" Tan ");
break;
case 2: printf(" Nham ");
break;
case 3: printf(" Quy ");
break;
case 4: printf(" Giap ");
break;
case 5: printf(" At ");
break;
case 6: printf(" Binh ");
break;
case 7: printf(" Dinh ");
break;
case 8: printf(" Mau ");
break;
case 9: printf(" Ky ");
break;
default: printf("");
}
switch (n%12)
{ case 0: printf("Than \n");
break;
case 1: printf("Dau \n");
break;
case 2: printf("Tuat \n");
break;
case 3: printf("Hoi \n");
break;
case 4: printf("Ty \n");
break;
case 5: printf("Suu \n");
break;
case 6: printf("Dan \n");
break;
case 7: printf("Mao \n");
break;
case 8: printf("Thin \n");
break;
case 9: printf("Ty \n");
break;
case 10: printf("Ngo \n");
break;
case 11: printf("Mui \n");
break;
default: printf("");
}
getch();
}
Câu 11: in chuoi moi tu mot dong
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int i,n;
printf(" nhap chuoi \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if (s[i]!=' ')
printf("%c",s[i]);
else printf("\n");
printf("\n");
getch();
}
Câu 12 : dem so tu trong chuoi
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if (((s[i]>64)&&(s[i]<91))||((s[i]>96)&&(s[i]<123)))
j++;
printf(" so tu trong chuoi la: %d \n",j);
getch();
}
Câu 13: xem chuoi co doi xung khong
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf("nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<(n/2);i++)
if (s[i]!=s[n-i-1])
{ j=1;
break;}
if (j==1)
printf(" chuoi khong doi xung \n");
else printf(" chuoi doi xung \n");
getch();
}
Câu14: nhap chuoi dem co baonhieu nguyen am u,e,o,a,i
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],i,n,j=0;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if ((s[i]=='u')||(s[i]=='e')||(s[i]=='o')||(s[i]=='a')||(s[i]=='i'))
j++;
printf(" so nguyen am la: %d \n",j);
getch();
}
Cau 18: in chuoi con tu chuoi tu ky tu dau den n ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j;
printf(" nhap chuoi: \n");
gets(s);
printf("nhap ki tu chi dinh \n");
scanf("%d",&i);
n=strlen(s);
for (j=0;((j<n)&&(j<i));j++)
t[j]=s[j];
if (i<n)
t[i]='\0';
else t[n]='\0';
printf(" chuoi con la: \n");
puts(t);
getch();
}

Cau 19 : in chuoi con tu ky tu thu i lay j ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,k;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
do
{ printf("nhap ki tu chi dinh \n");
scanf("%d",&i);
printf(" nhap so ky tu can tach \n");
scanf("%d",&j);}
while (i+j>n+1);
for (k=i;k<j+i;k++)
t[k-i]=s[k-1];
t[j]='\0';
printf(" chuoi con la: \n");
puts(t);
getch();
}
Cau 20 : in vi tri bat dau cua chuoi dich trong chuoi nguon
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,m,k;
printf(" nhap chuoi nguon: \n");
gets(s);
printf("nhap chuoi dich: \n");
gets(t);
n=strlen(s);
m=strlen(t);
k=n;
for (i=0;i<n-m+1;i++)
{ for (j=0;j<m;j++)
if (t[j]==s[j+i])
k=i;
else {k=n;break;}
if (k!=n)
break;}
if (k==n)
printf(" chuoi con khong dung \n");
else printf("vi tri bat dau cua chuoi con la: %d \n",k+1);
getch();
}
-----------------------------------------------------------------------------------------------
Cau 21 : xoa chuoi tu vi tri thu i voi j ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,k;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
printf("muon xoa tu vi tri nao \n");
scanf("%d",&i);
printf(" xoa bao nhieu ky tu \n");
scanf("%d",&j);
for (k=0;k<i-1;k++)
t[k]=s[k];
for (k=i+j-1;k<n;k++)
t[k-j]=s[k];
t[n-j]='\0';
printf(" chuoi sau khi xoa: \n");
puts(t);
getch();
}


Được sửa bởi Admin ngày 04/11/10, 05:25 am; sửa lần 2.
Về Đầu Trang Go down
https://spkt10301.forumvi.com
kysikhoailang
2 sao
2 sao
kysikhoailang


Tổng số bài gửi : 36
Points : 14910
Reputation : 0
Join date : 25/10/2010
Age : 35
Đến từ : BIEN HOA

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime03/11/10, 07:38 pm

e sao ko thay bai nao het vay ku, cu thay loading hoai
Về Đầu Trang Go down
duc loi
2 sao
2 sao
avatar


Tổng số bài gửi : 31
Points : 14909
Reputation : 0
Join date : 18/10/2010
Age : 37
Đến từ : ninh binh

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime03/11/10, 08:21 pm

baj gui bi loi roi doi minh chut nha
Câu 1: viết hàm tìm số lớn nhất, nhỏ nhất trong một mảng n số nguyên

/* chuong trinh tim min max cua mang gom n phan tu n<=100 */
#include <stdio.h>
#include <conio.h>

int tmax(int a[],int n)
{ int i,max;
max=a[0];
for (i=1;i<n;i++)
if (max<a[i])
max=a[i];
return max;
}

int tmin(int a[],int n)
{ int i,min;
min=a[0];
for (i=1;i<n;i++)
if (min>a[i])
min=a[i];
return min;
}

void main (void)
{ int a[100],n,i;
/* nhap n va kiem tra n thoa man 0<n<=100 */
do
{ printf(" nhap n \n");
scanf("%d",&n);
} while ((n<=0)||(n>100));
/* nhap vao n phan tu */
for (i=0;i<n;i++)
{ printf (" nhap phan tu a[%d]= \n",i);
scanf("%d",&a[i]); }

printf(" max la: %d \n",tmax(a,n));
printf(" min la: %d \n",tmin(a,n));
getch();
}
Câu 2:
viết hàm sắp xếp tăng dần, giảm dần của một dãy cho trước

/* chuong trinh tim sap xep tang dan, giam dan cua mang gom n phan tu n<=100 */
#include <stdio.h>
#include <conio.h>
void sxtd(int a[],int n)
{ int i,j,tam;
for (i=0;i<n;i++)
for (j=i+1;j<n;j++)
if (a[i]>a[j])
{tam=a[i];
a[i]=a[j];
a[j]=tam;}
}
/*********************/
void sxgd(int a[],int n)
{ int i,j,tam;
for (i=0;i<n;i++)
for (j=i+1;j<n;j++)
if (a[i]<a[j])
{ tam=a[i];
a[i]=a[j];
a[j]=tam; }
}
/*********************/
void main (void)
{ int a[100],n,i;
/* nhap n va kiem tra n thoa man 0<n<=100 */
do
{ printf(" nhap n \n");
scanf("%d",&n);
} while ((n<=0)||(n>100));
/* nhap vao n phan tu */
for (i=0;i<n;i++)
{ printf (" nhap phan tu a[%d]= \n",i);
scanf("%d",&a[i]); }
sxtd(a,n);
printf(" day tang dan: \n");
for (i=0;i<n;i++)
printf("%d ",a[i]);
sxgd(a,n);
printf(" \n day giam dan : \n");
for (i=0;i<n;i++)
printf("%d ",a[i]);
getch();
}

Câu 3:viết hàm tách tên và họ lót từ một chuổi cho trước
#include <stdio.h>
#include <conio.h>
#include <string.h>
void tach (char s[],char ten[],char lot[])
{ int i,j,n;
n=strlen(s);
for (i=n-1;i>0;i--)
if (s[i]==' ')
break;
for (j=0;j<i;j++)
lot[j]=s[j];
lot[i]='\0';
for (j=i+1;j<n;j++)
ten[j-i-1]=s[j];
ten[n-i-1]='\0';
}
void main(void)
{ char s[30],ten[20],lot[20];
printf(" nhap ho va ten \n");
gets(s);
tach(s,ten,lot);
printf (" \n ho va chu lot: \n");
puts(lot);
printf(" ten: \n");
puts(ten);
getch();
}


Câu4: cắt bỏ các khoảng trắng
#include <stdio.h>
#include <conio.h>
#include <string.h>
void catbo( char s[])
{ int n,i,j=0;
char t[30];
n=strlen(s);
for (i=0;i<n;i++)
if (s[i]!=' ')
t[i-j]=s[i];
else j++;
t[n-j]='\0';
strcpy(s,t);
}

void main(void)
{ char s[30];
printf(" nhap chuoi: \n");
gets(s);
catbo(s);
puts(s);
getch();
}

Câu 5 và 6: viết hàm chuyển đổi 1 chuổi sang thường, sang hoa, hàm chữ đầu là hoa còn lại thường
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <ctype.h>
void t_hoa(char s[])
{ int i,n;
n=strlen(s);
for (i=0;i<n;i++)
s[i]=toupper(s[i]);
}

void t_thuong(char s[])
{ int i,n;
n=strlen(s);
for (i=0;i<n;i++)
s[i]=tolower(s[i]);
}

void hoadd(char s[])
{ int i,n;
n=strlen(s);
s[0]=toupper(s[0]);
for (i=1;i<n;i++)
s[i]=tolower(s[i]);
}
void main(void)
{ char s[30];
printf(" nhap chuoi: \n");
gets(s);
t_hoa(s);
printf(" chuoi da doi thanh chu hoa: \n");
puts(s);
t_thuong(s);
printf(" chuoi doi thanh chu thuong: \n");
puts(s);
hoadd(s);
printf(" chuoi doi thanh chu hoa dau dong con lai thuong: \n");
puts(s);
getch();
}
--------------------------------------------------------------------------------------------
Câu 7: in chuỗi ngược

#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30],t[30];
int i,n;
printf(" nhap chuoi:\n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
t[i]=s[n-i-1];
t[n]='\0';
printf("chuoi dao nguoc: \n");
puts(t);
getch();
}
Câu 8: nhap vao chuoi dem bao nhieu chu ‘th’;
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf(" nhap chuoi \n ");
gets(s);
n=strlen(s);
for (i=0;i<n-1;i++)
if ((s[i]=='t')&&(s[i+1]=='h'))
j++;
printf("so chu 'th' co trong chuoi: %d \n",j);
getch();
}
Câu 9: nhap duong lich in ra nam am lich;
#include <stdio.h>
#include <conio.h>
void main(void)
{ int n;
printf(" nhap nam duong lich: \n");
scanf("%d",&n);
printf(" nam am lich la: \n");
switch (n%10)
{ case 0: printf(" Canh ");
break;
case 1: printf(" Tan ");
break;
case 2: printf(" Nham ");
break;
case 3: printf(" Quy ");
break;
case 4: printf(" Giap ");
break;
case 5: printf(" At ");
break;
case 6: printf(" Binh ");
break;
case 7: printf(" Dinh ");
break;
case 8: printf(" Mau ");
break;
case 9: printf(" Ky ");
break;
default: printf("");
}
switch (n%12)
{ case 0: printf("Than \n");
break;
case 1: printf("Dau \n");
break;
case 2: printf("Tuat \n");
break;
case 3: printf("Hoi \n");
break;
case 4: printf("Ty \n");
break;
case 5: printf("Suu \n");
break;
case 6: printf("Dan \n");
break;
case 7: printf("Mao \n");
break;
case 8: printf("Thin \n");
break;
case 9: printf("Ty \n");
break;
case 10: printf("Ngo \n");
break;
case 11: printf("Mui \n");
break;
default: printf("");
}
getch();
}
Câu 11: in chuoi moi tu mot dong
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int i,n;
printf(" nhap chuoi \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if (s[i]!=' ')
printf("%c",s[i]);
else printf("\n");
printf("\n");
getch();
}
Câu 12 : dem so tu trong chuoi
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if (((s[i]>64)&&(s[i]<91))||((s[i]>96)&&(s[i]<123)))
j++;
printf(" so tu trong chuoi la: %d \n",j);
getch();
}
Câu 13: xem chuoi co doi xung khong
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{ char s[30];
int n,i,j=0;
printf("nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<(n/2);i++)
if (s[i]!=s[n-i-1])
{ j=1;
break;}
if (j==1)
printf(" chuoi khong doi xung \n");
else printf(" chuoi doi xung \n");
getch();
}
Câu14: nhap chuoi dem co baonhieu nguyen am u,e,o,a,i
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],i,n,j=0;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
for (i=0;i<n;i++)
if ((s[i]=='u')||(s[i]=='e')||(s[i]=='o')||(s[i]=='a')||(s[i]=='i'))
j++;
printf(" so nguyen am la: %d \n",j);
getch();
}
Cau 18: in chuoi con tu chuoi tu ky tu dau den n ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j;
printf(" nhap chuoi: \n");
gets(s);
printf("nhap ki tu chi dinh \n");
scanf("%d",&i);
n=strlen(s);
for (j=0;((j<n)&&(j<i));j++)
t[j]=s[j];
if (i<n)
t[i]='\0';
else t[n]='\0';
printf(" chuoi con la: \n");
puts(t);
getch();
}

Cau 19 : in chuoi con tu ky tu thu i lay j ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,k;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
do
{ printf("nhap ki tu chi dinh \n");
scanf("%d",&i);
printf(" nhap so ky tu can tach \n");
scanf("%d",&j);}
while (i+j>n+1);
for (k=i;k<j+i;k++)
t[k-i]=s[k-1];
t[j]='\0';
printf(" chuoi con la: \n");
puts(t);
getch();
}
Cau 20 : in vi tri bat dau cua chuoi dich trong chuoi nguon
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,m,k;
printf(" nhap chuoi nguon: \n");
gets(s);
printf("nhap chuoi dich: \n");
gets(t);
n=strlen(s);
m=strlen(t);
k=n;
for (i=0;i<n-m+1;i++)
{ for (j=0;j<m;j++)
if (t[j]==s[j+i])
k=i;
else {k=n;break;}
if (k!=n)
break;}
if (k==n)
printf(" chuoi con khong dung \n");
else printf("vi tri bat dau cua chuoi con la: %d \n",k+1);
getch();
}
-----------------------------------------------------------------------------------------------
Cau 21 : xoa chuoi tu vi tri thu i voi j ky tu
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main(void)
{char s[30],t[30],i,n,j,k;
printf(" nhap chuoi: \n");
gets(s);
n=strlen(s);
printf("muon xoa tu vi tri nao \n");
scanf("%d",&i);
printf(" xoa bao nhieu ky tu \n");
scanf("%d",&j);
for (k=0;k<i-1;k++)
t[k]=s[k];
for (k=i+j-1;k<n;k++)
t[k-j]=s[k];
t[n-j]='\0';
printf(" chuoi sau khi xoa: \n");
puts(t);
getch();
}


Được sửa bởi Admin ngày 04/11/10, 05:23 am; sửa lần 4. (Reason for editing : Dời qua đây cho nó phù hợp. ^.^)
Về Đầu Trang Go down
h_thong_spk
2 sao
2 sao
h_thong_spk


Tổng số bài gửi : 26
Points : 14855
Reputation : 2
Join date : 02/11/2010
Age : 36

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime04/11/10, 08:07 pm

may chi co vay thoi ah
tu lam di roi dua len nha cung
Về Đầu Trang Go down
Admin
Admin
Admin
Admin


Tổng số bài gửi : 72
Points : 15004
Reputation : 4
Join date : 18/10/2010

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime04/11/10, 11:13 pm

Hix. Cho em thêm câu này cái.
Bài này là của "Giáo Sư" làm đó.
Không "Giáo Sư" chém em chết. :lol!:
Về Đầu Trang Go down
https://spkt10301.forumvi.com
dothuy_ccdt
2 sao
2 sao
dothuy_ccdt


Tổng số bài gửi : 48
Points : 14889
Reputation : 5
Join date : 30/10/2010
Age : 36
Đến từ : vinh phuc

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime12/11/10, 09:45 pm

cái này mình nghĩ nên trao đổi cách làm, ý tưởng về giải thuật chứ post lên nhiều bạn xem xong cũng chẳng hiểu. Chỉ học đối phó thôi! hihi
Về Đầu Trang Go down
nguyenvietxuan
2 sao
2 sao
avatar


Tổng số bài gửi : 29
Points : 14832
Reputation : -1
Join date : 13/11/2010

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime13/11/10, 08:20 pm

link down borland c++ 5.02 đây bà con
http://www.fileserve.com/file/5BNP4GQ
Về Đầu Trang Go down
nguyenvietxuan
2 sao
2 sao
avatar


Tổng số bài gửi : 29
Points : 14832
Reputation : -1
Join date : 13/11/2010

Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime13/11/10, 08:45 pm

Tớ có cái phần mềm borland c 3.01 , nó sẵn một số bài tập tham khảo post lên cho mấy pro coi chơi nè
Code:

http://www.mediafire.com/?gandy5asw89txfs
Về Đầu Trang Go down
Sponsored content





Giải bài tập Ngôn ngữ lập trình Empty
Bài gửiTiêu đề: Re: Giải bài tập Ngôn ngữ lập trình   Giải bài tập Ngôn ngữ lập trình Icon_minitime

Về Đầu Trang Go down
 
Giải bài tập Ngôn ngữ lập trình
Về Đầu Trang 
Trang 1 trong tổng số 1 trang
 Similar topics
-
» đề cương ngôn ngữ lập trình
» điểm cuối kỳ môn ngôn ngữ lập trình
» Những ca khúc hay nhất của Trịnh Công Sơn - The best of Trịnh Công Sơn . Những ca khúc hay nhất của Trịnh Công Sơn - The best of Trịnh Công Sơn
» Bài tập ngôn ngữ C từ A đến Z
» Ai Ngon Hơn

Permissions in this forum:Bạn không có quyền trả lời bài viết
DIỄN ĐÀN CỦA LỚP 10301 ĐH SPKT TP HCM :: HỌC HÀNH :: Học Kỳ I :: Ngôn ngữ lập trình-
Chuyển đến