This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int n=Integer.parseInt(scn.nextLine()); | |
while(n--!=0){ | |
char arr[]=scn.nextLine().toCharArray(); | |
int tot=0; | |
for(int i=0;i<arr.length;i++){ | |
tot+=arr[i]; | |
} | |
System.out.println(tot); | |
} | |
} | |
/* | |
題目:[C_MM275-易] 字串之編碼數值總和 | |
作者:1010 | |
時間:西元 2016 年 8 月 */ | |
} |