在C ++中从控制台读取 [英] Reading from the Console in C++

查看:112
本文介绍了在C ++中从控制台读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

a * r-c

3
1
c 3
r 2

我该如何阅读我写在顶部的输入并在堆栈和数组中使用它,有人知道这个问题吗?


[edit]将"c ++ da consoledan okuma"主题翻译成英文(感谢Google!)-OriginalGriff [/edit]

a*r-c
in
3
a 1
c 3
r 2

How can I read the input I wrote top and use it in a stack and array, is there anyone know the of this question...


[edit]"c++ da consoledan okuma" subject translated to English (Thanks Google!) - OriginalGriff[/edit]

推荐答案

我想你的意思是:
从控制台读取一行:它包含一个表达式
然后再读一遍:如果是"in",则输入跟随.
输入:Count,后跟表达式的每个元素,格式为:
名称"< space>值"

用输入值替换表达式元素并评估表达式.

如果是这样,则:使用Google.之前已经做过很多次了,以土耳其语找到合适的例子应该不难.如果这没有帮助,请张贴您到目前为止尝试过的内容,并说明问题所在.我们非常愿意提供帮助,但我们不会为您做功课!
I assume you mean:
Read from the console a line: this contains an expression
Then read another: If it is "in" then the inputs follow.
Inputs: Count, followed by each element of the expression in the form:
"name"<space>"value"

Replace the expression elements with the input values and evaluate the expression.

If so, then: use Google. This has been done so many times before, that it should not be difficult to find a suitable example in Turkish. If this is not helpful, then post what you have tried so far, and explain what your problem is. We are more than willing to help, but we won''t do your homework for you!


这篇关于在C ++中从控制台读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆