Hy vọng bản 10.4 sẽ cải thiện được chất lượng driver cho NVIDIA :D
Phù, học hơn 2 tháng bên này, tự nhiên ngẫm lại mình vẫn học hành ngẫu hứng như hồi còn ở nhà, quá đáng chán >”<. Bữa nay sẽ cố gắng ép mình vô thời gian biểu cụ thể, cố gắng thực hiện :D Bước đầu hy vọng làm được như thế này
Thứ 2-4-6 : Học ở trường tới 5h chiều , từ 8h-11h tối tự học
Thứ 3 : Có lab tới 2h chiều, từ 3h->8h làm bài về nhà, ăn chơi nhảy múa, tối tự học theo lịch cũ
Thứ 5: Có nên giải lao tí không nhỉ? Làm bài về nhà xong lại ăn chơi nhảy múa
Thứ 7: Freeeeeeeee!
Chủ nhật: Cày :))
Nói chung là vẫn có nhiều thời gian ăn chơi quá, nhưng khởi đầu như thế có lẽ hợp lý hơn :D Hy vọng thằng roommate đừng rủ rê cũng như quậy phá để có thể hoàn thành kế hoạch :))
Chùm phượng vĩ em cầm là tuổi tôi mười tám…
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.23
* Bach Tran
* ID no. 14112496
*/
#include<stdio.h>
int main()
{
int first, flip;
int c, state, type;
state=1;
type=first=0;
flip=1;
while ((c=getchar())!= EOF)
{
if (type==2 && c=='\n')
{
state=1;
type=0;
flip=1;
putchar(c);
}
else if (state==1 && c!='/' && c!='*' && c!='\\')
{
if (flip==0 &&((first=='*')||(first=='/')||(first=='\\')))
putchar(first);
putchar(c);
first=c;
flip=0;
}
else
{
if (first=='/' && c=='*' && state==1)
{
type=1;
state=0;
flip=1;
}
else if (first=='/' && c=='/' && state==1 )
{
type=2;
state=0;
flip=1;
}
else if (first=='*' && c=='/' && type==1)
{
state=1;
type=0;
flip=1;
}
else
flip=0;
if (state==1 && flip==0 &&((first=='*')||(first=='/')||(first=='\\')))
putchar(first);
first=c;
}
}
return 0;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.17
* Bach Tran
* ID no. 14112496
*/
#include<stdio.h>
#define MAX 1000
#define RE 80
int main()
{
int line[MAX];
int state;
int c, length, i;
length = 0;
state = 0;
while ((c=getchar())!= EOF)
{
if (c!= '\n')
{
length++;
line[length-1]=c;
//state=1;
//printf("%d \n", length);
}
else
{
if (length>=RE)
{
for (i=0; i<length; ++i)
putchar(line[i]);
putchar('\n');
}
//printf("%d \n", length);
length=0;
//state=1;
}
}
return 0;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.15
* Bach Tran
* ID no. 14112496
*/
#include<stdio.h>
#define MAX 300
#define STEP 20
int i;
float convert(int farh);
int main()
{
for (i=0; i<=MAX; i=i+STEP)
printf("%3d %.1f\n",i,convert(i));
return 0;
}
float convert(int farh)
{
float c;
c=5.0*(farh-32)/9;
return c;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.13
* Bach Tran
* ID no. 14112496
*/
#include<stdio.h>
#define MAX 99
int main()
{
int l_array[MAX];
int i, c, in, length, index;
in=0;
index=0;
length=0;
for (i=0; i<MAX; ++i)
l_array[i]=0;
while ((c=getchar()) !=EOF)
{
if (c==' ' || c=='\t' || c=='\n')
{
if (in != 0)
++l_array[length-1];
in=0;
length=0;
}
else
{
++length;
in=1;
}
}
/*
* Print the horizontal table
*/
printf("The horizontal histogram \n");
printf("\nWord with length || Graph \n");
int j;
for (i=0; i<MAX; ++i)
if (l_array[i]!=0)
{
printf("%16d || ",i+1);
for (j=1; j<=l_array[i]; j++)
putchar('*');
printf("\n");
}
/*
* Print the vertical histogram
*/
printf("\nThe horizontal histogram \n");
int maxline;
maxline=0;
for (i=0; i<MAX; ++i)
if (l_array[i]>maxline)
maxline=l_array[i];
for (i=maxline; i>0; --i)
{
printf(" %2d || ", i);
for (j=0; j<MAX; ++j)
if (l_array[j]>=i)
{
printf(" * ");
}
else if (l_array[j]!=0)
printf(" ");
printf("\n");
}
printf("Length || ");
for (i=0; i<MAX; ++i)
if (l_array[i]!=0)
printf("%2d ",i+1);
getchar();
return 0;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.12
* Bach Tran
* ID no. 14112496
*/
#include <stdio.h>
int main()
{
int c;
int in;
in=0;
while ((c=getchar()) !=EOF)
{
if (c==' ' || c=='\t' || c=='\n')
{
if (in==1)
{
in=0;
printf("\n");
}
}
else
{
putchar(c);
in=1;
}
}
return 0;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.9
* Bach Tran
* ID no. 14112496
*/
#include <stdio.h>
main()
{
int c,state;
state = 0;
while ((c = getchar()) != EOF) {
if (c !=' ')
{
state=1;
putchar(c);
}
else if (state==1 && c==' ')
{
putchar(c);
state=0;
}
else
state=0;
}
return 0;
}
/*CMP_SC 2110
* Dr. Jianlin Cheng
* Exercise no 1.7
* Bach Tran
* ID no. 14112496
*/
#include <stdio.h>
main()
{
printf("The value of EOF is %d\n", EOF);
return 0;
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 