int

    0熱度

    1回答

    我想從兩個文本框輸入輸入創建兩個整數的字符串添加在一起。我不斷收到,基本上只是說:「索引必須是該列表的範圍內」 這裏的錯誤是我的代碼 private char[] array1; private char[] array2; String input1 = tbUserInput1.Text; array1 = input1.ToCharArray(); int[]

    -5熱度

    2回答

    我直接放置代碼。 #include <stdio.h> struct A { int a; int b; }; int main() { struct A test; double *p = (double *)&(test.a); *p = 5; printf("variable a: %d\n", &test.a);

    1熱度

    2回答

    給定類型爲int的python中的變量,例如, z = 50 type(z) ## outputs <class 'int'> 有這個變量轉換成numpy.int64一個簡單的方法? 它似乎必須將此變量轉換爲一個numpy數組,然後將其轉換爲int64。這感覺頗爲複雜。 https://docs.scipy.org/doc/numpy-1.13.0/user/basics.types.ht

    -1熱度

    5回答

    我想做一個方法的'差異',找到一個int數組中的最大數字並將int返回給主方法。我得到一個錯誤,告訴我我無法將int數組轉換爲int。我該如何做這項工作?我不想返回整個數組。非常感謝 public class bigDiff{ public static void main(String[] args){ int[] arr = new int[] {7, 6, 8, 9};

    -2熱度

    2回答

    我有在訂單信息的JSON對象編號。在此目的例如"amount" : "82.95" 我有這樣的一個變量中稱爲$amount和我的量我正在通過做(int)$amount來使用它。 這樣做的問題是,它將刪除所需的.95,因爲它是一個整數。 如何將此值作爲數字而不是字符串而不是字符串,但保留.95? 實施例: $amount = 82.95; echo (int)$amount; // Resul

    -7熱度

    1回答

    我一直在努力使這項工作,我正在工作的項目,無論我嘗試的int和字符串不會比較,當我只是一個整數它doesn工作不正常。有沒有辦法讓代碼工作並比較整數和字符串? if(a == Lust || b != Lust) { win = win + 20; balance = balance - 20; }

    3熱度

    4回答

    #include <stdio.h> int main() { short int a; char c; printf("%d %d %d",sizeof(a),sizeof(c),sizeof(c+a)); } 4字節而不是在該函數sizeof一個是炭的2字節大小爲1個字節,但我把它們加起來它給4字節。它在表達式中做了什麼來使其成爲4

    -1熱度

    3回答

    我試圖將Int的輸入直接轉換爲字符串。 我也試圖讓程序在信用卡序列中找到正確的號碼,以使其正確。 例如,如果我輸入一個不正確的信用卡號碼,程序會找到一種方法來更改數字,以便它變得正確。 public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println(

    2熱度

    4回答

    我無法弄清楚如何讓try catch工作。在文本框中輸入非數字時,需要彈出錯誤消息框。 private void btnAdd_Click(object sender, EventArgs e) { int x = int.Parse(txtIn1.Text); int y = int.Parse(txtIn2.Text); txtIn1.Text

    0熱度

    4回答

    的可能範圍,我的ID(int)像 [1,2,3,5,7,8,11,13,14..] 列表是有一個快速/智能方式(LINQ?)來獲取所有的id,或者如果可能的話,範圍是多少? 結果應該像[1-3, 5, 7-8, 11, 13-14]。 當然,很容易循環和計算int值來獲得結果,但我確定必須有一個更簡單的方法來做到這一點。