|登录 |注册

查看: 969|回复: 7
打印 上一主题 下一主题

需要帮忙。

[复制链接]
AirWalker
2010-3-24 06:45 PM
我正在做assignment,但我有点不明白他的问题,想请大大们帮我看看。
The program basically asks the users for a value (s) then calculates and displays the First, Middle, Last, and Final. The users have a choice to enter the value either in integer, real or character. If the user enters it in real or character, it will be converted into integer value before the required value is computed.

请问character convert 成 integer 是什么意思呢? character 像 abc?? 要怎么convert呢?
Super-Tomato
2010-3-24 09:27 PM
我正在做assignment,但我有点不明白他的问题,想请大大们帮我看看。
The program basically asks the users for a value (s) then calculates and displays the First, Middle, Last, and Final. The users have a choice to enter the value either in integer, real or character. If the user enters it in real or character, it will be converted into integer value before the required value is computed.

请问character convert 成 integer 是什么意思呢? character 像 abc?? 要怎么convert呢?
AirWalker 发表于 2010-3-24 06:45 PM


注意題目是 character 而不是 characters 或 string
如果真是題目要一串文字的話, 逐個轉換後加起來吧
AirWalker
2010-3-24 09:32 PM
这个题目的input是给formula用的,所以应该只是转换字母成int,要怎么转换呢?
Super-Tomato
2010-3-24 09:34 PM
这个题目的input是给formula用的,所以应该只是转换字母成int,要怎么转换呢?
AirWalker 发表于 2010-3-24 09:32 PM



這就要看你是否了解你所使用的編程語言了
AirWalker
2010-3-24 09:48 PM
我用C++ ,有什么建议吗?
Super-Tomato
2010-3-24 10:15 PM
我用C++ ,有什么建议吗?
AirWalker 发表于 2010-3-24 09:48 PM



有空去翻翻之前的帖子, 裡面應該多少會給你些啟發
AirWalker
2010-3-24 10:37 PM
好的,谢谢你。。。
~Zero
2010-3-25 02:10 AM
你试试.
  1. char c = 'A';
  2. int i = (int) c;
  3. cout << i ;
复制代码
code 方面有没有错我不清楚, 我没学过 C++. 你试试这个概念.
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2026-1-1 06:53 AM , Processed in 0.095895 second(s), 24 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部