void setup(){
size(600,300);
background(0);
//set base value of variable
//N is real number
//sum is sum of count to N
//count is value for check rule
int count=0;
int sum=0;
int N=100;
textSize(30);
text("Sum of "+count,200,100);
text(" to " +N,350,100);
while(count<=N){
sum=sum+count;
count++;
}
text("Sum is "+sum,200,200);
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น