24小时热门版块排行榜    

查看: 529  |  回复: 5

Carryjoe

新虫 (初入文坛)

[求助] 在线提交出现 Runtime Error 错误提示 已有1人参与

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _9206
{
    class Program
    {
        static void Main(string[] args)
        {
            double x, y;
            string s;
            while((s=Console.ReadLine())!=null)
            {
                x = double.Parse(s);
                if (x < 0)
                    y = 0;
                else if (0 <= x && x < 10)
                    y = 2 * x;
                else if (10 <= x && x < 50)
                    y = 2 * x + 1;
                else
                    y = x / 2 + 50;
                Console.WriteLine("{0:F2}", y);
            }
        }
    }
}
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

感谢参与,应助指数 +1
CODE:
#include <iostream.h>
class STUDENT //建立一個結構叫做STUDENT
{
public:
int no;
int age;
};
void main()
{
STUDENT curtis;
cout << "請輸入學生編號:";
cin >> curtis.no ;
cout << "請輸入學生年齡:" ;
cin >> curtis.age ;
cout << curtis.no << endl << curtis.age ;
}

2楼2016-10-06 22:09:02
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

Carryjoe

新虫 (初入文坛)

引用回帖:
2楼: Originally posted by FMStation at 2016-10-06 22:09:02
#include <iostream.h>
class STUDENT //建立一個結構叫做STUDENT
{
public:
int no;
int age;
};
void main()
{
STUDENT curtis;
cout << "請輸入學生編號:";
cin >> c ...

文不对题啊

发自小木虫Android客户端
3楼2016-10-10 07:47:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

??? main()

????????????e????T???????????
4楼2016-10-10 09:20:08
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

次序錯
CODE:
namespace _9206
{
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}

5楼2016-10-10 09:21:35
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

FMStation

至尊木虫 (知名作家)

【答案】应助回帖

http://www.cplusplus.com/doc/tutorial/classes/
CODE:
// classes example
#include <iostream>
using namespace std;

class Rectangle {
    int width, height;
  public:
    void set_values (int,int);
    int area() {return width*height;}
};

void Rectangle::set_values (int x, int y) {
  width = x;
  height = y;
}

int main () {
  Rectangle rect;
  rect.set_values (3,4);
  cout << "area: " << rect.area();
  return 0;
}

6楼2016-10-10 09:22:46
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 Carryjoe 的主题更新
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 329求调剂 +3 钮恩雪 2026-03-25 3/150 2026-03-25 14:43 by 糖加冰
[考研] 材料学硕,求调剂 6+4 糖葫芦888ll 2026-03-22 9/450 2026-03-25 11:19 by greychen00
[考研] 07化学280分求调剂 +7 722865 2026-03-23 7/350 2026-03-25 09:29 by aa331100
[考研] 生物学学硕求调剂 +7 小羊睡着了? 2026-03-23 10/500 2026-03-25 02:24 by 清风拂扬。 m
[考研] 一志愿南航材料专317分求调剂 +5 炸呀炸呀炸薯条 2026-03-23 5/250 2026-03-24 16:52 by 星空星月
[考研] 291求调剂 +3 HanBeiNingZC 2026-03-24 3/150 2026-03-24 16:34 by barlinike
[考研] 一志愿吉大化学322求调剂 +4 17501029541 2026-03-23 6/300 2026-03-24 10:21 by 戴围脖的小蚊子
[考研] 344求调剂 +3 desto 2026-03-24 3/150 2026-03-24 10:09 by 搏击518
[考研] 一志愿山东大学药学学硕求调剂 +3 开开心心没烦恼 2026-03-23 4/200 2026-03-24 00:06 by 开开心心没烦恼
[考研] 一志愿北京化工大学 070300 学硕 336分 求调剂 +7 vv迷 2026-03-22 7/350 2026-03-23 23:44 by Txy@872106
[考研] 一志愿重庆大学085700资源与环境,总分308求调剂 +7 墨墨漠 2026-03-23 8/400 2026-03-23 20:36 by Creta
[论文投稿] 急发核心期刊论文 +3 贤达问津 2026-03-23 5/250 2026-03-23 17:13 by 妹子不好惹
[考研] 350求调剂 +6 weudhdk 2026-03-19 6/300 2026-03-23 15:47 by tangyuan0840221
[考研] 328求调剂 +4 LHHL66 2026-03-23 4/200 2026-03-23 14:55 by lbsjt
[考研] 280分求调剂 一志愿085802 +4 PUMPT 2026-03-22 7/350 2026-03-22 22:13 by 星空星月
[考研] 求调剂 +5 Zhangbod 2026-03-21 7/350 2026-03-22 13:13 by Zhangbod
[考研] 考研调剂 +3 呼呼?~+123456 2026-03-21 3/150 2026-03-21 20:04 by 无际的草原
[考研] 一志愿深大,0703化学,总分302,求调剂 +4 七月-七七 2026-03-21 4/200 2026-03-21 18:20 by 学员8dgXkO
[考研] 288求调剂 +16 于海海海海 2026-03-19 16/800 2026-03-20 22:28 by JourneyLucky
[考研] 261求B区调剂,科研经历丰富 +3 牛奶很忙 2026-03-20 4/200 2026-03-20 19:34 by JourneyLucky
信息提示
请填处理意见