#9295: 簡易加減


a13559132000 (阿瑞)


各位高手好,小弟我的邏輯很差,這題我是用C解,不知道是哪裡錯誤,請幫我解答,謝謝您。

#include<stdio.h>

int main(){

  int i,j,temp=0;

  while(scanf("%d %d",&i,&j)!=EOF){

    if((i<0) || (j<0)){

      i=i*(-1);

      j=j*(-1);

    }

    if((i<1000000) && (j<1000000))

      printf("%d\n%d",i,j);

    }

    temp=i+j;

    printf("%d\n",temp);

    return 0;

  

#9348: Re:簡易加減


asdst7878 (unknown)


#include<stdio.h>

 

int main(){

 

  int i,j,temp=0;

 

  while(scanf("%d %d",&i,&j)!=EOF){

 

 

 

    temp=i+j;

 

    printf("%d\n",temp);

}

 

    return 0;

 

  

 

 解決