小编Chr*_*ris的帖子

C中的字符串解析

你如何将字符串1234567解析为单个数字?

c

2
推荐指数
1
解决办法
402
查看次数

当我打算输出Char时,我的Char数组是打印输出的数字

这是我的代码

    Scanner in = new Scanner(new File("words.txt"));
    int choice = 0;
    String str = in.next();
    int FileSize = Integer.parseInt(str);
    char[] wordPlay = new char[100]; 
    System.out.println("Filesize = " + FileSize); 
    int i = 0;
    int count = 0;
    String[] word = new String[FileSize];
    String randomWord;
    Random R = new Random();
    for(i = 0; i < FileSize; i++)
    {
        word[i] = in.next();
        System.out.println("Words = " + word[i]);
    }
    count = R.nextInt(FileSize);
    randomWord = word[count];
    System.out.println("Randomword = "+ randomWord);
    int size = randomWord.length(); …
Run Code Online (Sandbox Code Playgroud)

java

0
推荐指数
1
解决办法
803
查看次数

标签 统计

c ×1

java ×1