这是我的功能:
(defun MyFunction(input)
(let ((NEWNUM (find input num)))
(if (find input num) //if this
(setq num NEWNUM) (FUNCT2) //then execute both of these
(list 'not found)))) //else output this
Run Code Online (Sandbox Code Playgroud)
所以在if声明之后我希望能够执行,(setq num NEWNUM)然后(FUNCT2)设置一个新变量,然后调用一个函数.关于如何做到这一点的任何想法?
我在这里有一些代码:
int i = 0;
StreamReader re = File.OpenText("TextFile1.txt");
string input = null;
while ((input = re.ReadLine()) != null)
{
string[] sites = input.Split(' ');
for (int j = 0; j < sites.Length; j++)
{
MyArray[i, j] = Convert.ToInt32(sites[j]);
}
i++;
}
for (int a = 0; a < 5; a++)
{
for (int j = 0; j < 5; j++)
{
Console.Write(MyArray[a, j] + " ");
}
Console.WriteLine();
}
Run Code Online (Sandbox Code Playgroud)
我的问题是这行代码
MyArray[i, j] = Convert.ToInt32(sites[j]);
Run Code Online (Sandbox Code Playgroud)
它被转换为int,如何将其转换为浮点数?
如果我有这个功能:
min(List1, List2, Output) :-
length(List1, N),
length(List2, M),
( N < M ->
Output = 'true'
; Output = 'false'
).
Run Code Online (Sandbox Code Playgroud)
但如果我还想检查N == M怎么办?也许是这样的:
min(List1, List2, Output) :-
length(List1, N),
length(List2, M),
( N < M ->
Output = 'true'
; ( N = M ->
Output = 'equal'
; Output = 'other'
)
).
Run Code Online (Sandbox Code Playgroud)
似乎没有用.
我知道你可以使用这个表将十进制转换为BCD:
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
是否存在此转换的等式或您只需使用该表?我试图为这个转换写一些代码,但我不知道如何为它做数学.建议?
我有一个UIImageView对象,单击它时会播放动画,我想重用相同的代码来制作多个对象.如何设置发件人标签以使其知道其不同的对象?
.H
- (IBAction)startClick:(id)sender;
Run Code Online (Sandbox Code Playgroud)
.M
- (IBAction)startClick:(id)sender
{
//UIImageView *theButton = (UIImageView *)sender.tag;
bubble.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed: @"Pop_1.png"],
[UIImage imageNamed: @"Pop_2.png"],
[UIImage imageNamed: @"Pop_3.png"], nil];
[bubble setAnimationRepeatCount:1];
bubble.animationDuration = 1;
[bubble startAnimating];
}
Run Code Online (Sandbox Code Playgroud) 任何人都可以善良,并告诉我如何在visual studio 2008中为基于win32控制台的c ++程序制作一个exe文件?谢谢
我有一张地图:
Map<String, String> ht = new HashMap();
Run Code Online (Sandbox Code Playgroud)
我想知道如何搜索它并找到与特定字符串匹配的任何内容.如果它是匹配存储它成为arraylist.地图包含这样的字符串:
1,2,3,4,5,5,5
匹配的字符串为5.
所以我有这个:
String match = "5";
ArrayList<String> result = new ArrayList<String>();
Enumeration num= ht.keys();
while (num.hasMoreElements()) {
String number = (String) num.nextElement();
if(number.equals(match))
{
result.add(number);
}
}
Run Code Online (Sandbox Code Playgroud) 我希望用户输入"Sun"并将其表示为"1".
Console.Write("Enter a Day: ");
day = Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)
可以这样做吗?
如果可以从源文件中读取,如下所示:
string fileContent = Resources.Users;
using (var reader = new StringReader(fileContent))
{
string line;
while ((line = reader.ReadLine()) != null)
{
string[] split = line.Split('|');
string name = split[0];
string last = split[1];
}
}
Run Code Online (Sandbox Code Playgroud)
那你怎么写同一个文件?
当用户将鼠标悬停在不同的标签上时,我希望文本下方有一个小三角形.这是我正在使用的一些代码.