디시인사이드 갤러리

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

갤러리 본문 영역

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

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 66 추천 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 - -
298448 c언어 고수 성님들~ [4] 123(210.218) 12.01.12 139 0
298447 blind sql injection에 대해서 아시는 분? ㅇㅅㅇ(111.118) 12.01.12 67 0
298445 html css 자바스크립트 배우는 책 html(112.146) 12.01.12 103 0
298444 형님들 도와주세요~~~~~~ [1] SoliCode갤로그로 이동합니다. 12.01.12 52 0
298443 안드로이드 태블릿 [2] sloth_갤로그로 이동합니다. 12.01.12 83 0
298441 님들 해커 간지 내는법좀 알려주세여 [16] ㅇㅇ(121.132) 12.01.12 238 0
298440 프로그래밍 갤러리에도 공무원 생각중인 형들 있어? 광란의디씨질갤로그로 이동합니다. 12.01.12 87 0
298439 제가요 보안쪽으로 가려고 하는데요 [2] 장떡갤로그로 이동합니다. 12.01.12 97 0
298438 삼성소프트웨어멤버십?? 여기무슨 쓰레기집단이냐 [2] 아넬카(218.209) 12.01.12 381 2
298435 프로그래밍 하면 하드웨어도 잘뜯어고칠줄 안다? [9] 에헹헹헤(211.221) 12.01.12 216 0
298434 초봉 실수령 300이면 존나 많이 받는거? [1] 킁킁(183.99) 12.01.12 206 0
298433 비주알 정품 쓰는 사람 있음? [3] 1(211.197) 12.01.12 83 0
298432 나 연봉 4000만 되도 아이코 감사 핥핥 하면서 살게싿 [1] 1(211.197) 12.01.12 74 0
298431 다들꿈의 연봉이 얼마라고 생각함? [2] 부왘(183.99) 12.01.12 171 0
298430 웹프로그래밍 할줄 아는 형들.. 이 태그 뭐가 잘못된거? ㅇㅇ(115.86) 12.01.12 54 0
298429 운동 끝났어여 뿌우 SODMaster갤로그로 이동합니다. 12.01.12 38 0
298427 형아 한양대 컴공 신입생인대여 [6] 신입생ㅇㄴㅁ(124.54) 12.01.12 215 0
298426 혹시?? 독수리산 보셨어요//?//? 학교가자갤로그로 이동합니다. 12.01.12 33 0
298425 삼전 무선 초봉이 [1] 푸의미래갤로그로 이동합니다. 12.01.12 168 0
298424 삼성 멤버십 기술면접 후기 [6] ㅅㅅㅅ(182.208) 12.01.12 427 0
298423 형들 자바 질문 있어요 초보(203.241) 12.01.12 53 0
298422 미국 회사 분위기 VS 한국 회사 분위기 [2] 1(211.197) 12.01.12 207 0
298421 나름대로 희망적인 말을 들엇는데 [5] 신미애갤로그로 이동합니다. 12.01.12 211 0
298419 유럽은 17살부터 일할수 있음 1(211.197) 12.01.12 53 0
298417 내일 세미나 자료준비중인데..키노트 정말 괜찮네 ㅋ [1] 캐맥닭(115.92) 12.01.12 88 0
298416 신조어 만들어 내자 다운증후군 1(211.197) 12.01.12 41 0
298414 여자가 병신인 이유 [1] 1(211.197) 12.01.12 96 0
298413 SM에 대해 어찌 생각해?? [1] 거칠게갤로그로 이동합니다. 12.01.12 145 0
298411 님들 중에 운동 하시는분? [3] 1(211.197) 12.01.12 69 0
298410 비수알 2010 prenium 받는중 1(211.197) 12.01.12 33 0
298409 스티브잡스는 97년 애플으로 돌아온 뒤에 단 1주도 매각하지 않았다 ㅁㄴㄻㄹ갤로그로 이동합니다. 12.01.12 84 0
298408 프로그래밍하는 형들은 성격이 내성적이지만 않으면 좋을텐데 [6] 광란의디씨질갤로그로 이동합니다. 12.01.12 244 0
298406 난 일단 운동해야 하니두시간 후에 오겠습니다. [1] SODMaster갤로그로 이동합니다. 12.01.12 38 0
298405 아니 나 게이컨셉 버렸어. [5] SODMaster갤로그로 이동합니다. 12.01.12 65 0
298404 쿄스케형은 아스형 얼굴 알지? [4] SODMaster갤로그로 이동합니다. 12.01.12 69 0
298403 webGL 지원되는 브라우저 뭐있냐? [2] 웹지엘(183.1) 12.01.12 97 0
298402 형들 질문좀 쒦뚫쉚뚫샒휆뚫뚫쒦갤로그로 이동합니다. 12.01.12 34 0
298401 우리는 imf 세대 아니냐 [1] 거칠게갤로그로 이동합니다. 12.01.12 92 0
298400 근데 아스횽이 그렇게 잘생겼다매? [3] SODMaster갤로그로 이동합니다. 12.01.12 62 0
298398 이러니 죄다 대기업, 공기업, 공뭔 이야기 하는거다. [4] 거칠게갤로그로 이동합니다. 12.01.12 225 0
298393 어쨋든 다시, 쿄스케형이 남자를 끊다니 이게 무슨소리? [5] SODMaster갤로그로 이동합니다. 12.01.12 78 0
298392 야잌 짤이 뭐 어떻다고 지우냐 알바야! SODMaster갤로그로 이동합니다. 12.01.12 48 0
298391 쎾쓰들아 5900도 못받는 애들은 칼퇴하자!!! 거칠게갤로그로 이동합니다. 12.01.12 124 0
298389 1년전에 SK T-TOWER에 두달 정도 출근했었는데 말야..... [2] 야요이갤로그로 이동합니다. 12.01.12 652 0
298388 깝깝하네 [6] 퐈응퐈응갤로그로 이동합니다. 12.01.12 90 0
298387 나도 피해자다 개심심(61.73) 12.01.12 38 0
298386 나도피해자다..근데 엿같은 중고등학교교육 싴보이갤로그로 이동합니다. 12.01.12 64 0
298385 아 진짜 솔까 교육문제도 터질때 되지 않았냐? [3] 쒦뚫쉚뚫샒휆뚫뚫쒦갤로그로 이동합니다. 12.01.12 109 0
298384 컴공 전망이 어떤가요?? [2] 질문좀요(121.167) 12.01.12 452 0
298383 나도 주입식,암기식 교육의 피해자지.... [9] 야요이갤로그로 이동합니다. 12.01.12 221 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2