zoukankan      html  css  js  c++  java
  • BNU 1001 北师大ACM新手指导/ICPC introduction(1)

    北师大ACM新手指导/ICPC introduction(1)

    1000ms  65536KB
     
    64-bit integer IO format: %lld      Java class name: Main
    前言/Introduction

    English version is available at the bottom. (English descriptions are marked blue.)


    此题主要是为了对于ACM新队员熟悉和了解ACM竞赛而设置。
    首先,关于ACM竞赛可以通过点击这里查看:
    ACM竞赛介绍

    学校和教务处对于ACM竞赛获奖选手可以在保研中加分,
    更多的信息可以查看此贴:
    写给大一,大二的同学

    教务处对于我校ACM选手也提供了专门的培训经费,详情可以向冯速老师了解。

    说明

    ACM因为是国际竞赛,所以是英文的,通常有一定的格式,一般分别以下几部分:
    1、标题
    2、时间和内存的限制(Time Limit, Memory Limit)
    3、题目的描述(Description)
    4、输入数据的描述(input)
    5、输出数据的描述(output)
    6、输入数据样例(Sample Input)
    7、输出数据样例(Sample Output)

    本题就可以做为一道ACM题的样例,大家现在看到的就是描述部分。

    提交代码

    在本网页的最下方,你可以看到有"[submit]"链接,点submit之后你就可以看到一个提交框,把你写好的代码复制粘贴到上面,再按submt就可以上传到服务器上,让服务器对你的代码进行检查,如果正确,系统将返回"accepted".

    好,介绍了这么多,下面请同学们完成一道ACM题,题目的要求是:
    输出"Hello World",并回车。

    如果你觉得此题有难度,请参考以下的代码:

    #include <stdio.h>

    int main()
    {
            printf("Hello World ");
      return 0;
    }


    请看懂之后,自己写一遍,不要用我的代码。
    以上代码是经过处理,直接复制提交将不能通过。
    只有自己写一遍才行。

    English Version:

    This series of problems are provided as an introductory level training for beginners. Through the training, one can be familiar to the ICPC contest and may move for bigger challenges.

    Search ACM/ICPC for more details.

    A problem description includes:

    1 - title

    2 - Time and memory limit             - specifies the maximum acceptable time and memory for a problem

    3 - Description                                  - describes the task you are supposed to solve

    4 - input format

    5 - output format                              - specifies the format for your program. Your program should exactly follow this format in order to be accepted.

    6 - Sample input                              - Gives a set of test cases.

    7 - Sample output                            - Gives the corresponding output of the sample input. This can be used to clarify the problem and counter check your program.

    Now the thing you are reading is an example for a problem description in ICPC style.

    The task for you is: Output "Hello World", and an "end of line" (Enter).

    If you do not know where to start, here is a piece of code for your reference:

    #include <stdio.h>
    int main()
    {
            printf("Hello World ");
      return 0;
    }

    Code submission

    A button "submit" can be found at the end of this page. After clicking on it, a pop up dialog box will appear. Copy and paste your code to the text box, click on "submit" again to upload your code. The server will run your program and check with all test cases. You will see "Accepted" if your program passed all the test cases.

    Want to have a try? Go go go!

    Input

    没有输入内容

    (No input)

     

    Output

    输出Hello World

    Output "Hello World" (The stuff inside the quotation.)

     

    Sample Output

    Hello World
     

    Hint

    关于判题系统
    About the online Judge


    判题是由机器自动完成的,所以选手的程序输出内容必须严格正确,不能多一个空格或回车!更不用说打错一个字符了。请试着将上面的正确代码改成以下内容并提交,比较系统的返回结果:
    The evaluation of your code is done by another program. Therefore, your output should mathch EXACTLY with the correct answer. Let's modify the code you have submitted a little:


    #include <stdio.h>

    int main()

    {
            printf("Hello  World "); /*中间多了一个空格, There is an extra space btw two words*/
            return 0;
    }



    #include <stdio.h>

    int main()

    {

            printf("Hello World "); /*最后多了一个空格, there is an extra space in the end*/
            return 0;
    }



    #include <stdio.h>

    int main()

    {
            printf("Hello world "); /*World第一个字母W小写了, the W is changed to lower case*/
            return 0;
    }



    试过的同学可以看到,即使是一点点的小错,都可能造成整个程序的错误,所以ACM竞赛要求队员有严谨的做题态度,
    哪怕是一点小错都可能造成程序错误。

    You will see from these example that if your output is changed only a little, your code will not be considered as acceptable. Double check your output before you submit.

    关于int main

    有些同学可能会奇怪,为什么这里要写成int main呢?可以写成void main吗?答案是:不可以。
    在99年C标准委员会推出了新的C语言标准,称作C99标准。
    该标准规定main函数必须返回int型。所以99年以后出现的编译器都遵循该标准。本系统采用的是GNU-GCC编译器,为linux系统指定的编译器。其严格遵循C99标准,所以请同学们养写好的编程习惯,一定要写int main()。

    BNU OJ 入门题,写一个Hello World

    1 #include<iostream>
    2 
    3 using namespace std;
    4 
    5 int main()
    6 {
    7         cout<<"Hello World"<<endl;
    8         return 0;
    9 }
    [C++]
  • 相关阅读:
    再谈Linux内核中的RCU机制
    Linux下的crontab定时执行任务命令详解
    Linux 2.6内核中新的锁机制--RCU
    linux内核自锁旋spinlock常用宏解释
    Linux内核list/hlist解读
    Linux下0号进程的前世(init_task进程)今生(idle进程)----Linux进程的管理与调度(五)
    Linux下的进程类别(内核线程、轻量级进程和用户进程)以及其创建方式--Linux进程的管理与调度(四)
    Linux进程ID号--Linux进程的管理与调度(三)
    内核源码阅读(三)进程命名空间和用户命名的实现
    Linux的命名空间详解--Linux进程的管理与调度(二)
  • 原文地址:https://www.cnblogs.com/lzj-0218/p/3200677.html
Copyright © 2011-2022 走看看