디시인사이드 갤러리

갤러리 이슈박스, 최근방문 갤러리

갤러리 본문 영역

횽들 이거 머가 잘못된거야?

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 67 추천 0 댓글 2

#include<stdio.h>

int menu();
void print(struct balance_sheet* b, struct statement_pnl* s);
void calculate(struct balance_sheet *b, struct statement_pnl *s);

struct balance_sheet//대차대조표
{
 int curasset;//유동자산
 int fixasset;//고정자산
 int toproperty;//자산총계
 int curliabilities;//유동부채
 int fixliabilities;//고정부채
 int toliabilities; //부채총계
 int castock;//자본금
 int casurplus;//자본잉여금
 int easurplus;//이익잉여금
 int tocapital;//자본총계
};

struct statement_pnl//손익계산서
{
 int sales;//매출액
 int costsales;//매출원가
 int toporfit;//매출총이익
 int salenmanage;//판매비와 관리비
 int opprofit; //영업이익
 int nopprofit;//영업외수익
 int nopexpense;//영업외비용
 int orincome;//경상이익
 int spprofit;//특별이익
    int spnoprofit;//특별손실
 int cotax; //법인세
 int netincome;//당기순이익
};

int main()//재무재표 data 를 입력받는다.
{
 struct balance_sheet bal;
    struct statement_pnl sta;

 struct balance_sheet* b;
    struct statement_pnl* s;

 int a;
start:
    a = menu();
 while(a>2)
 {
 a=menu();
 if(a<3)
  {
  break;
  }
 }         

 switch(a)
 {
 case 1:
 printf("대차대조표의 다음 항목을 입력해 주십시요.\n");
 printf("유동자산\n");
 scanf("%d",&bal.curasset);
 printf("고정자산\n");
 scanf("%d",&bal.fixasset);
 printf("유동부채\n");
 scanf("%d",&bal.curliabilities);
 printf("고정부채\n");
 scanf("%d",&bal.fixliabilities);
 printf("자본금\n");
 scanf("%d",&bal.castock);
 printf("자본잉여금 \n");
 scanf("%d",&bal.casurplus);
 printf("이익잉여금\n");
 scanf("%d",&bal.easurplus);

 printf("손익계산서의 항목을 입력해 주십시요.\n");
 printf("매출액\n");
 scanf("%d",&sta.sales);
 printf("매출원가\n");
 scanf("%d",&sta.costsales);
 printf("판매비와 관리비\n");
 scanf("%d",&sta.salenmanage);
 printf("영업외수익 \n");
 scanf("%d",&sta.nopprofit);
 printf("영업외비용\n");
 scanf("%d",&sta.nopexpense);
    printf("특별이익액\n");
 scanf("%d",&sta.spprofit);
 printf("특별손실액\n");
 scanf("%d",&sta.spnoprofit);
 printf("법인세\n");
 scanf("%d",&sta.cotax);
 break;

 case 2:
 printf("손익계산서의 항목을 입력해 주십시요.\n");
 printf("매출액\n");
 scanf("%d",&sta.sales);
 printf("매출원가\n");
 scanf("%d",&sta.costsales);
 printf("판매비와 관리비\n");
 scanf("%d",&sta.salenmanage);
 printf("영업외수익 \n");
 scanf("%d",&sta.nopprofit);
 printf("영업외비용\n");
 scanf("%d",&sta.nopexpense);
    printf("특별이익액\n");
 scanf("%d",&sta.spprofit);
 printf("특별손실액\n");
 scanf("%d",&sta.spnoprofit);
 printf("법인세\n");
 scanf("%d",&sta.cotax);
 
 printf("대차대조표의 다음 항목을 입력해 주십시요.\n");
 printf("유동자산\n");
 scanf("%d",&bal.curasset);
 printf("고정자산\n");
 scanf("%d",&bal.fixasset);
 printf("유동부채\n");
 scanf("%d",&bal.curliabilities);
 printf("고정부채\n");
 scanf("%d",&bal.fixliabilities);
 printf("자본금\n");
 scanf("%d",&bal.castock);
 printf("자본잉여금 \n");
 scanf("%d",&bal.casurplus);
 printf("이익잉여금\n");
 scanf("%d",&bal.easurplus);
 break;
 }
 
 b = &bal;
 s = &sta;

 print(b,s);
    calculate(b, s);
 printf("---------------------------------------------\n");
 printf("다른 기업도 분석 하시겠습니까?\n");
    printf("1.네 다른 기업도  분석하겠습니다.\n");
    printf("2. 아니요 이만 됐습니다.\n");
 printf("---------------------------------------------\n");
 printf("위에서 원하는 번호를 선택하십시요.");
 scanf("%d",&a);
 switch(a)
 {
 case 1:
  goto start;
 break;
 case 2:
 break;
 }

return 0;
}

int menu()
{
 int a;
 printf("재무분석 프로그램을 이용해 주셔서 감사합니다.\n");
 printf("---------------------------------------------\n");
 printf("[주의]프로그램 사용중 꼭 숫자만 입력하시기 바랍니다.\n");
 printf("---------------------------------------------\n");
    printf("/      1. 대차대조표 부터 입력              /\n");
    printf("/      2. 손익계산서 부터 입력              /\n");
    printf("---------------------------------------------\n");
    printf("원하는 번호를 입력해 주세요.");
 scanf("%d",&a);
 return a;
}

void print( struct balance_sheet* b, struct statement_pnl* s)
{
printf("재무재표 분석\n");
printf("------------<대차대조표>-----------\n");
printf("유동자산%d\n",b->curasset);
printf("고정자산%d\n",b->fixasset);
printf("자산총계%d\n",b->toproperty = b->curasset + b->fixasset);
printf("유동부채%d\n",b->curliabilities);
printf("고정부채%d\n",b->fixliabilities);
printf("부채총계%d\n",b->toliabilities = b->curliabilities + b->fixliabilities);
printf("자본금%d\n",b->castock);
printf("자본잉여금%d\n",b->casurplus);
printf("이익잉여금 %d\n",b->easurplus);
printf("자본총계%d\n",b->tocapital = b->casurplus + b->easurplus);
printf("-----------------------------------\n");

printf("------------<손익계산서>-----------\n");
printf("매출액%d\n",s->sales);
printf("매출원가%d\n",s->costsales);
printf("매출총이익%d\n",s->toporfit = s->sales + s->costsales);
printf("판매비와 관리비%d\n",s->salenmanage);
printf("영업이익%d\n",s->opprofit = s->toporfit - s->salenmanage);
printf("영업외수익 %d\n",s->nopprofit);
printf("영업외비용%d\n",s->nopexpense);
printf("경상이익 %d\n",s->orincome = s->opprofit + s->nopprofit - s->nopexpense);
printf("특별이익%d\n",s->spprofit);
printf("특별손실%d\n",s->spnoprofit);
printf("법인세%d\n",s->cotax);
printf("당기순이익 %d\n",s->netincome = s->orincome + s->spprofit - s->spnoprofit - s->cotax);
printf("-----------------------------------\n");
}

void calculate(struct balance_sheet *b, struct statement_pnl *s)//입력받은 data 분석&분석결과 출력
{
char c;
c='%';
float dr; //부채비율
float pm; //매출 총이익률
float pps; //매출순이익률
float roe; //자기자본이익률
float cr; //유동비율
dr =  (float)b->toliabilities / (float)b->tocapital *100;//부채/자본
pm = (float)s->toporfit / (float)s->sales *100;//매출총이익/매출액
pps = (float)s->netincome / (float)s->sales *100;//당기순이익/매출액
roe=(float)s->netincome/b->tocapital*100;//당기순이익/자기자본
cr = (float)b->curasset / (float)b->curliabilities *100;//유동자산/유동부채
 printf("---------------------------------------------\n");
printf("부채비율: %f %c입니다.\n",dr,c);
printf("매출 총이익률: %f %c입니다.\n",pm,c);
printf("매출 순이익률: %f %c입니다.\n",pps,c);
printf("자기자본이익률: %f %c입니다.\n",roe,c);
printf("유동비율: %f %c입니다.\n",cr,c);
 printf("---------------------------------------------\n");
}


좀 알려줘... F받기 시러서그래...ㅠㅠㅠ

추천 비추천

0

고정닉 0

0

댓글 영역

전체 댓글 0
본문 보기

하단 갤러리 리스트 영역

왼쪽 컨텐츠 영역

갤러리 리스트 영역

갤러리 리스트
번호 제목 글쓴이 작성일 조회 추천
설문 이성 보는 눈 없어서 걱정되는 스타는? 운영자 25/11/10 - -
AD 겨울가전 SALE! 쿨한 겨울 HOT세일 운영자 25/11/12 - -
298851 ㅁㄶㅁㄶ ㅁㄴㄹ(125.135) 12.01.15 19 0
298850 형님들 php나 제로보드로 대학총동문회 사이트 만들어야 되는데 도와주세요 [6] 123(121.88) 12.01.15 84 0
298849 해외 해외 하니 나도 목표중 하나가 해외 대학원.. +어게인갤로그로 이동합니다. 12.01.15 80 0
298848 어디에 있는 코드게? [1] elwlwlwk갤로그로 이동합니다. 12.01.15 55 0
298847 컴자격증 많이 따보신 님들아 [5] 비수쉴드갤로그로 이동합니다. 12.01.15 99 0
298844 나 고3때 수리 가 모의 100점 맞았었음.. [2] ㅋㄱ(183.96) 12.01.15 87 0
298843 치킨 무시하지 마라능. ㅇㅇ [1] ☎v2.0™갤로그로 이동합니다. 12.01.15 77 0
298842 형들 나 수리5등급에 수포자인데ㅋㅋㅋ [3] 어려운리눅스갤로그로 이동합니다. 12.01.15 91 0
298841 형들 나 아랫글보니궁금한거 [1] 코딩...?갤로그로 이동합니다. 12.01.15 40 0
298840 컴공? 컴과? [9] 전과생(121.167) 12.01.15 194 0
298839 어플,프로그램,웹사이트 만들려면 무슨학과가야되요? [6] 어려운리눅스갤로그로 이동합니다. 12.01.15 105 0
298838 파이썬 input() 함수 질문좀 [2] ThinkCHAN갤로그로 이동합니다. 12.01.15 165 0
298837 해외 회사 입사 내가 아는 루트들. ㅇㅇ [3] ☎v2.0™갤로그로 이동합니다. 12.01.15 196 0
298836 으엥 코딩...?갤로그로 이동합니다. 12.01.15 27 0
298835 이거 왜이런거에요ㅠ 댓글점여ㅠ 심각해요ㅠ [1] 글쓴이(121.165) 12.01.15 64 1
298834 Win7 64bit VS2010에서 FreeGLUT 사용 - 링크 오류 [9] wiu갤로그로 이동합니다. 12.01.15 264 0
298831 킁.. 집에서 회사일 하기 무지 싫넹. [10] ☎v2.0™갤로그로 이동합니다. 12.01.15 142 0
298829 프로그래밍을 배우고싶은 학생이질문하나해요 ㅠㅠ [2] 초보(211.229) 12.01.15 59 0
298828 뜬금없지만 라면 종결자 [4] 바보플머(222.121) 12.01.15 129 0
298826 프로그래머로 미국회사 취업하려면 스펙어느정도 되야돼? [5] ㅁㅁㅁ(121.164) 12.01.15 270 0
298825 엔진이 한종류인줄로만 알았는데 아니네.. [7] +어게인갤로그로 이동합니다. 12.01.15 126 0
298823 클라이언트 프로그래머 되려는데 커리큘럼 비교좀 해주세요!!!!!!~~~~ [2] 맹러(175.123) 12.01.15 128 0
298821 전에 나 집에 있을때 집으로 온 전화 기억난다 [2] dlbo갤로그로 이동합니다. 12.01.15 44 0
298818 횽들 class를 사용하려면 iostream이 필요한거야???? [1] 플밍 초보 (121.164) 12.01.15 4710 0
298817 우리 이모부.. 보이스 피싱 당하셨다네..... [5] 쿄스케갤로그로 이동합니다. 12.01.15 114 0
298816 프갤러 형들 프갤 늅인데 인턴 질문좀(계약직같은거) 정육갤로그로 이동합니다. 12.01.15 43 0
298815 역시 임베디드 치킨이 제일 좋겠어 dlbo갤로그로 이동합니다. 12.01.15 43 0
298814 c언어 공부하면서 수학딸린다는게 존나 느껴져서 수학공부 시작하려고 하는데 [5] 세탁범갤로그로 이동합니다. 12.01.15 155 0
298813 어제도 올렸지만 답이 없던 질문 재질문합니당. [2] SODMaster갤로그로 이동합니다. 12.01.15 55 0
298812 C#이 C++ 보다 좋은 점에 대한 질문에 대해서... [1] 바보플머(222.121) 12.01.15 148 0
298811 그것에 대해서 무엇을 얼마나 아느냐가 중요한게 아닌 것 같다. [2] 바보플머(222.121) 12.01.15 68 0
298808 정보처리기사 이제 비전공이면 경력 꼭 필요하냐? [2] 으헝(58.122) 12.01.15 163 0
298807 for 문 뒤에는 ; 안붙여도 됨/?? [4] 노소프소갤로그로 이동합니다. 12.01.15 98 0
298806 횽들 개뉴비가 c sprintf 질문좀 할게요 [2] 노소프소갤로그로 이동합니다. 12.01.15 54 0
298805 좆뉴비인데 횽들 API 뭐로해야할지도와줘,, 123(58.148) 12.01.15 44 0
298804 퇴사한지 2주째 [1] 므해?갤로그로 이동합니다. 12.01.15 109 0
298803 c#이 c++보다 낳은점이 뭐가있나여 [1] 회전매니아갤로그로 이동합니다. 12.01.15 118 0
298801 하아 Expert C Programming이책 넘 구하기 힘들다 [2] 일광면(119.198) 12.01.15 93 0
298800 말년 휴가 나왓는데 .. 코딩 기억나나 찍어볼려고 햇는데 [1] 까르갤로그로 이동합니다. 12.01.15 59 0
298799 윈도우7도 콘솔 고자였네 dot(125.128) 12.01.15 59 0
298798 밑에글 요약 (테트리스 정도는 초등학생도 쉽게 만들 수 있는가?) [7] qxq(59.24) 12.01.15 235 0
298796 허세 부리지 말고 까놓고 말해서... [3] qxq(59.24) 12.01.15 185 0
298795 형님들 전자10(115.21) 12.01.15 21 0
298794 인공지능은 컴퓨터 과학/공학과 다른 독자적인 학문분야일세... [5] ㅇㅇ(221.147) 12.01.15 205 0
298793 형들 기업에서 요구하는게 c야 c++이야? [4] 김탱구○갤로그로 이동합니다. 12.01.15 197 0
298791 인공지능 존내 발전하면 [2] 천재(211.197) 12.01.15 106 0
298790 인공지능은 90년대에 유망하다던 분야인데 망했어요 [7] [성대아싸]갤로그로 이동합니다. 12.01.15 260 0
298789 바이러스 의심가는 exe파일 안전하게 여는 법 없나여 [3] 하니하니.갤로그로 이동합니다. 12.01.15 91 0
298788 나도 인공지능에 관심 있는데 [11] 천재(211.197) 12.01.15 158 0
298787 이거 C로 반복문 안써서 구현할수 있나요? [8] omaggo갤로그로 이동합니다. 12.01.15 163 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2