import java.util.Scanner;
public class Main {
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
while(sc.hasNext()){
int n=sc.nextInt();
System.out.println(getPrice(n));
}
}
public static int getPrice(int n) {
int t=1;
int m=2;
int i=0;
if(n<1){
System.out.println("输入错误");
}
while(t<=n){
t+=m;
m++;
if(t<=n){
i++;
}
}
return n-i*2;
}
}
网友评论