Giter Club home page Giter Club logo

pat's Introduction

pat's People

Contributors

tangjinzhou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pat's Issues

1006.js

没啥好说的,刷的第一题,测试环境用

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout
});
rl.on('line', function (cmd) {
  var bai = Math.floor(cmd/100);
  var shi = Math.floor(cmd%100/10);
  var ge = Math.floor(cmd%10);
  var str = '';
  for(var i = 0;i < bai; i++) {
    str += 'B';
  };
  for (var i = 0; i < shi; i++) {
    str += 'S';
  };
  for (var i = 0; i < ge; i++) {
    str += (i + 1);
  };
  console.log(str);
});

乙级 1038 最后一个测试点错误,请问你有办法吗?

var i = 1;
var grade;
require("readline")
    .createInterface(process.stdin, process.stdout)
    .on("line", function (str) {
    if (i == 1) {
        i++;
        return;
    }
    if (i == 2) {
        grade = str.split(" ").map(function (item) { return parseInt(item); });
        i++;
        return;
    }
    if (i == 3) {
        var match_1 = str.split(" ").map(function (item) { return parseInt(item); }).slice(1);
        var result_1 = match_1.map(function () { return 0; });
        grade.forEach(function (item) {
            var index = match_1.indexOf(item);
            if (index != -1)
                result_1[index]++;
        });
        console.log(result_1.join(" "));
        process.exit(0);
    }
});

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.