Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  sm
Language: C/C++
Code:
#include <stdio.h>

int main(void) {
     int n1, n2,tick,result;
     int i,s;
     printf("잔고 입력 : ");
     scanf("%d",&result);
     printf("시장가 거래수(첫 체결 거래수 제외)  : ");
     scanf("%d",&tick);
     for(i=0; i<=tick; i++)
     {
     printf("시장가 거래 손익  : ");
     scanf("%d",&n1);
     s+=n1;
     }
     printf("총손익  : ");
     scanf("%d",&n2);
     result-=n2;     
     n2-=s;
     printf("시장가 : %d",s);
     printf("장중 : %d",n2);
     
}
          
Comments: