gpt4 book ai didi

java - 将单词 "one"更改为数字 "1"等等

转载 作者:行者123 更新时间:2023-11-30 08:25:13 26 4
gpt4 key购买 nike

<分区>

我不是要你们在得到想法之前就完成我的工作,只是我被交给了这个任务

Complete the function int comp(String s1, String s2). For this function, s1 and s2 are one of the following "one","two","three","four". For example, s1 might be two and s2 might be four. Clearly s1 and s2 correspond to numbers. The function comp should return a negative number if s1 (as a number) is less than s2 (as a number), zero if they are equal (as numbers), and a positive number otherwise. For example, comp("two","four") should return a negative number because 2 is less than 4.

但是我不知道如果 s1 已经被分配为“1”,我将如何分配 1。

有什么建议吗?

最好的问候。

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com