import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int a = scanner.nextInt();
int b = scanner.nextInt();
Boolean flag=true;
int c=a+b;
if(c<0){
flag=false;
c=Math.abs(c);
}
String s = Integer.toString(c);
StringBuilder builder = new StringBuilder();
int count=0;
for (int i = s.length()-1; i >=0; i--) {
builder.append(s.charAt(i));
count++;
if(count%3==0&&i>0){
builder.append(',');
}
}
if(flag==false){
builder.append('-');
}
StringBuilder builder1 = builder.reverse();
String s1 = builder1.toString();
System.out.println(s1);
}
}
1001 A+B Format
最新推荐文章于 2024-10-31 15:56:11 发布