Git Product home page Git Product logo

Comments (4)

mexbo avatar mexbo commented on July 27, 2024

感觉逻辑不对,假如说只有输入 5 0 ,你的代码是没有输出的,while循环一直在等待输入,没有中断,但题目要求的是输出“0 0”

from pat.

xlucn avatar xlucn commented on July 27, 2024

@mexbo 经验证,确实通过不了了。但是当时应该是通过的啊,我每次push都会检查的

不过,我代码里用的是

while(scanf("%d %d", &coef, &index) != EOF) 

来判断输入结束,就是说不能判断回车,只能通过输入流/文件的结束来判断。测试的时候可以使用输入文件,或者使用Ctrl+D来结束输入。如果这个地方出问题的话我怀疑是PAT的测试设置有变化

from pat.

mexbo avatar mexbo commented on July 27, 2024

可能吧

from pat.

xlucn avatar xlucn commented on July 27, 2024

找到问题了,之前这样的输出方法

printf("%c%d %d", count++ ? ' ' : '\0', coef * index, index - 1);

是可以通过的,但是现在可能这个\0的输出会造成问题。

具体原因我还不明白,输出的内容看起来是不会影响的,以后恐怕不能这么写了

from pat.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.