Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fly tree huan patch 1 #5

Open
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

fly-tree-huan
Copy link

完成了一部分。。

Copy link
Owner

@luckymark luckymark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

进展神速啊,厉害!

int main()
{
cin>>a;
/* for(int i=1;i<100;++i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有了git,一般就不要用注释语句来保留旧代码了

int main()
{
time_t start = clock();
printf("2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是几个意思呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接输出答案自然是最快的。。。。。 ( * ^_^ * )

{
time_t start = clock();
//printf("2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997");
for(int i=2;i<=n;++i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原来如此啊,上面那个是用来做对比的?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是正常的写法 ( * ^_^ * )
PS:只不过写在了一起,改了注释进行提交

//��100��Χ����֤��°ͺղ������ȷ��
#include<bits/stdc++.h>
using namespace std;
int pr[]={2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个数组为何不用代码来生成呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

范围太小,直接赋值写起来比写p05_1的代码快

unsigned long long n;
int main()
{
cin>>n;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊,我没把需求写清楚,这个题目是要求打印出移动的步骤,例如:
A->C
C->B
...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9号上课时按要求写了新的,然后忘了在github上更新,(lll¬ω¬)

printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
printf("#��ǰ���й���%d�ֻ���\n",num);
for(int i=1;i<=num;++i)
cout<<"��"<<i<<"�֣�"<<s[i].mtype<<" "<<s[i].nums<<endl;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题同上

bool meql(char a[],char b[])
{
for(int i=0;a[i]||b[i];++i)
if(a[i]!=b[i])return 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里看起来,让我有点抓狂哈

else
{
printf("#������.\n");
printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smell,闻到了重复的味道(与126行相同)

FILE *fp=fopen("saved.txt","r");
fscanf(fp,"%d",&num);
for(int i=1;i<=num;++i)
fscanf(fp,"%s%d",&s[i].mtype,&s[i].nums);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

{
start();
cin>>tmp;
while(tmp<1||tmp>4){printf("����ָ��\n#����������#\n");cin>>tmp;}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般不要写到同一行里!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下次一定(lll¬ω¬)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants