int

    1熱度

    5回答

    我是java新手,正在研究一個接受輸入並將其保存在ArrayList中以執行計算的crud計算器。 我試圖在ArrayList<Character>中添加兩個值,然後用總和替換「+」。 if(listEqu.contains('+')) { while(listEqu.indexOf('+') > -1) { int plus = listEqu.indexOf('+

    -2熱度

    1回答

    如何將像'123'這樣的字符串轉換爲int 1,2和3,以便我可以執行1 + 2 + 3。我是python的新手。你能幫我麼?我無法分割清單。由於沒有分隔符,我不認爲分割字符串是有用的。你能幫我理解這個弦元素怎麼能被分離和對待爲整數?

    -3熱度

    2回答

    嗨,我是一個begginer c程序員,我試圖做一個過濾器應該改變一個變量取決於其他變量,但它似乎並沒有改變變量g1出於某種原因。我真的很喜歡我能得到的任何幫助,因爲我現在被困在這裏。謝謝 #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void) { int car; int g1

    -4熱度

    4回答

    所以我試圖向左移動一個數組,例如,如果原始數組是'1,2,3,4',轉換後的數組將變爲'2,3,4, 1',這是我到目前爲止,我不斷得到一個缺少返回語句錯誤,我將如何去解決它? public int shift (int [] d){ for(int from =1; from <= d.length-1; from++) d[from-1]= d[from];

    1熱度

    1回答

    我正在創建一個項目,其中隨機圖像顯示,當我點擊一個按鈕,圖像(骰子)的總數將不得不被猜出。我已經有了隨機圖像生成和跟蹤卷的人數。然而;我不知道如何使骰子(圖片)具有一定的價值。就像骰子5顯示的那樣,其值爲4.該人在guessBx中猜出猜測並點擊guessBtn,如果他們是正確的,它將彈出。 這裏是我的代碼截至目前: using System; using System.Collections.G

    -4熱度

    1回答

    #include <iostream> #include <math.h> using namespace std; int main() { int l,b,h; int s; s=(l+b+h); float ar=s*(s-l)*(s-b)*(s-h); float area; int ch; cout<<"H

    0熱度

    3回答

    當我嘗試寫到另一個文件,我得到一個錯誤說: TypeError: write() argument must be str, not int 我如何寫一個int到一個文件?下面是我當前的代碼 infile = open("milk.in","r").readlines() outfile = open("milk.out","w") a, b = infile[0].split() a

    0熱度

    3回答

    int b, c, d; cin >>b>>c>>d; int **a[b]; for(int i=0;i<b;++i){ *a[i]=new int[c]; for(int j=0;j<c;j++){ a[i][j]=new int[d]; } } 我想創建一個3維int.I認爲問題是當我創建第二個維度時,它不是一個指針,我無法創建第3個維度

    -5熱度

    3回答

    #This is a sucky program. print('hello') print('What\'s your name?') MyName = input() MyNameInt = int(len(MyName)) if MyNameInt > 15 print('Long name.') 我想讓它響應長名稱,但它似乎並沒有工作。提示?

    0熱度

    1回答

    點數 所以有很多的算法來評估一個int是否是迴文,即 def ReverseNumber(n, partial=0): if n == 0: return partial return ReverseNumber(n // 10, partial * 10 + n % 10) 或者這一個: def isPalindrome(x): if (x < 0)