分页: 1 / 1

#1 ddd

发表于 : 2024年 6月 29日 20:49
peace11
ddd

#2 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 21:02
(ヅ)
def foo(str):
if len(str) == 0:
return []
if len(str) == 1:
return [str]
l = foo(str[0:len(str) - 1])
c = str[-1]
return [it + c for it in l] + [it + "_" + c for it in l]

#3 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 21:05
Rabboni
(ヅ) 写了: 2024年 6月 29日 21:02 def foo(str):
if len(str) == 0:
return []
if len(str) == 1:
return [str]
l = foo(str[0:len(str) - 1])
c = str[-1]
return [it + c for it in l] + [it + "_" + c for it in l]
瓦特法克,python冒充C#。

#4 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 21:07
(ヅ)
Rabboni 写了: 2024年 6月 29日 21:05 瓦特法克,python冒充C#。
道理不一样的嘛,转一下就好了

using System;
using System.Collections.Generic;

public class Solution
{
public static List<string> Foo(string str)
{
if (str.Length == 0)
return new List<string>();
if (str.Length == 1)
return new List<string> { str };

List<string> l = Foo(str.Substring(0, str.Length - 1));
char c = str[str.Length - 1];

List<string> result = new List<string>();
foreach (string it in l)
{
result.Add(it + c);
result.Add(it + "_" + c);
}
return result;
}
}

#5 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 21:23
peace11
ddd

#6 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 21:45
(ヅ)
peace11 写了: 2024年 6月 29日 21:23 Thank you very much!

I can not run your above code in https://onecompiler.com/csharp/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;


namespace HelloWorld
{
public class Solution
{
public static void Main(string[] args)
{
Console.WriteLine(string.Join(",", Foo("street")));
}
public static List<string> Foo(string str)
{
if (str.Length == 0)
return new List<string>();
if (str.Length == 1)
return new List<string> { str };

List<string> l = Foo(str.Substring(0, str.Length - 1));
char c = str[str.Length - 1];

List<string> result = new List<string>();
foreach (string it in l)
{
result.Add(it + c);
result.Add(it + "_" + c);
}
return result;
}
}
}

第一次写c#,怪怪的

#7 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 22:14
peace11
thank you so very much!

#8 Re: 付报酬求一小段c#的编程

发表于 : 2024年 6月 29日 22:56
peace11
ddd

#9 Re: 付报酬求一小段编程

发表于 : 2024年 6月 29日 22:58
(ヅ)
用selenium

#10 Re: 付报酬求一小段编程

发表于 : 2024年 6月 29日 23:09
peace11
ddd

#11 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 03:28
webdriver
杀猪的?

#12 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 11:34
bigbendan
bot 注册?

好的网站应该有防止爬虫或者恶意注册的吧?

#13 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 11:40
StMichael
Chatgpt搞不定么?

#14 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 11:43
benadryl
花二十刀买一个月的ChatGPT,这些小程序最擅长了吧?估计不买subscription也行。

#15 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 11:53
StMichael
不用付费版就可以
benadryl 写了: 2024年 6月 30日 11:43 花二十刀买一个月的ChatGPT,这些小程序最擅长了吧?估计不买subscription也行。

#16 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 12:10
sos2010
马公都堕落到这个地步了?

#17 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 15:34
webdriver
记住:凡是留qq邮箱的,100分之200,是干坏事的,lol

#18 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 18:33
LightFast
webdriver 写了: 2024年 6月 30日 15:34 记住:凡是留qq邮箱的,100分之200,是干坏事的,lol
有可能是小刘找人帮写作业。

#19 Re: 付报酬求一小段编程

发表于 : 2024年 6月 30日 20:30
webdriver
LightFast 写了: 2024年 6月 30日 18:33 有可能是小刘找人帮写作业。
你点这个ID,看看他发了几个帖子,一目了然啊