디시인사이드 갤러리

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

갤러리 본문 영역

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

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 60 추천 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 저녁 뭐먹지? 오늘의 메뉴 추천! 운영자 25/10/31 - -
298124 Mysql 계정 권한주는데 안되요 ㅠㅠ [2] 에휴(203.171) 12.01.11 52 0
298123 근데 내 오른쪽 눈만 시력이 안좋아진게 [2] elwlwlwk갤로그로 이동합니다. 12.01.11 126 0
298121 해피투게더 재방보는데 [1] ㅋㄱ(183.96) 12.01.11 63 0
298120 아오 이제 자야겠다~~ 오늘 너무 버닝했네 거칠게갤로그로 이동합니다. 12.01.11 61 0
298119 난 아직도 여자들의 내숭과 거절을 잘 구분 못하겠어 -_- [1] 거칠게갤로그로 이동합니다. 12.01.11 139 0
298118 진짜 여자들의 위장술은 조심해야 한다 [1] 거칠게갤로그로 이동합니다. 12.01.11 196 0
298115 아무리 날고 겨도 등장 임팩트는 SES가 최고지 [5] 야요이갤로그로 이동합니다. 12.01.11 89 0
298114 걸그룹 중 베스트 오브 베스트를 뽑아보자!! [7] 거칠게갤로그로 이동합니다. 12.01.11 95 0
298113 걸그룹의 최고봉을 결정하자!! [10] 거칠게갤로그로 이동합니다. 12.01.11 111 0
298112 내가 아는 걸그룹 목록 [24] 거칠게갤로그로 이동합니다. 12.01.11 153 0
298111 진짜, 좋아요.~~Good.// [1] 학교가자갤로그로 이동합니다. 12.01.11 23 0
298110 같은 과로 얘도 갠찬치안스믑니까/ [5] ㅋㄱ(183.96) 12.01.11 161 0
298108 진심은 통한다는 말 따윈 이제 믿지않는다. 진심(211.221) 12.01.11 68 0
298106 내 공부 로드맵인데 좀 봐주라 [4] 도와주십시오(59.26) 12.01.11 195 0
298105 잠이 안온다. [1] ssonacy갤로그로 이동합니다. 12.01.11 52 0
298103 오픈지엘 조명쏘는데염.. ㅋㄱ(183.96) 12.01.11 48 0
298102 기초 기초 하는데 기초가 뭐임? [11] 뀨잉뀨잉(211.221) 12.01.11 212 1
298098 RCE 어떨까 [4] lucy_han갤로그로 이동합니다. 12.01.11 44 0
298097 [IT취업고민 끝~ 한국산업단지,중앙일보hta 전원채용확정교육] [5] 채용담당(219.255) 12.01.11 132 0
298095 체감 연봉 5천.. [13] K(125.186) 12.01.11 234 0
298094 스크린샷 깨짐현상에 대해 질문드려요 [1] ㅜㅜ(203.250) 12.01.10 50 0
298093 구조체 클래스??? [14] ㅋㄱ(183.96) 12.01.10 105 0
298092 형들 나 모든 확장자가 실행이 안됨... [3] 유동닉(183.108) 12.01.10 42 0
298090 디시 검색기능 좀 병신같이 바뀌지 않았음? [4] ㅇㅇㅇ(121.144) 12.01.10 173 0
298089 존내 멋진 공뭔들의 프로그램 배포방식.... [3] ㅅㄱㅅㄱㅅㄱ갤로그로 이동합니다. 12.01.10 127 0
298088 오랜만이에여 [3] 풀개미'ㅅ'갤로그로 이동합니다. 12.01.10 47 0
298087 아 공부하기 싫다 [4] 퐈응퐈응갤로그로 이동합니다. 12.01.10 70 0
298086 jdk 7 path 설정 좀 도와주세요...솦갤 정전이에요 제발 ㅜㅜ [3] 늅늅이(180.227) 12.01.10 65 0
298085 대2 되는 컴공학생인데요 방학때 뭐 공부할만한것좀요.. [21] 질문좀요(121.167) 12.01.10 217 0
298084 빚 진 것 다 갚았다 [1] 이모군(175.114) 12.01.10 66 0
298083 안녕프겔 [5] 어떡해갤로그로 이동합니다. 12.01.10 98 0
298082 횽들~ 개발자들 업무복장은 어떻게되요? [4] ㅂㅈㄷㄱ(180.67) 12.01.10 142 0
298081 게임업계 포트폴리오 내는데 얼굴인식 시스템 만든거 내면 좆되나? ㅋㅋㅋㅋ [3] ㅁㄴㅇㄹ(59.30) 12.01.10 150 0
298077 포트폴리오 제출 어떻게 하나요? [4] ㅁㄴ(210.107) 12.01.10 91 0
298076 아까 올라온 글에 웹디가 있는거 같던데 KA-1(210.106) 12.01.10 42 0
298075 수능 수리나형 vs c언어 [1] ㅇㅇ(175.211) 12.01.10 114 0
298073 5군데 이력서 넣었는데..... [1] 퐈응퐈응갤로그로 이동합니다. 12.01.10 102 0
298071 SUlinux어떰?? [4] C_Perl갤로그로 이동합니다. 12.01.10 51 0
298070 현재242,355의 위치의 픽셀의 색상값을 엑셀에G13에 표시하려면 엑셀(216.232) 12.01.10 309 0
298069 연봉 5천준다고 오라는데..어쩔까.... [1] 캐뻘짓닭(115.92) 12.01.10 213 0
298068 회사에 여자플머 4명이 있다. [1] 캐뻘짓닭(115.92) 12.01.10 234 0
298066 형들 병특질문점요 [2] aaasss(121.166) 12.01.10 102 0
298065 눈 안좋아지게 하는 방법이 뭐가 있을까 [7] elwlwlwk갤로그로 이동합니다. 12.01.10 151 0
298064 컴공가면 병특 가능?? [3] dd(175.211) 12.01.10 191 0
298063 C언어 배워보려고 열혈강의C프로그래밍 빌려왔는데 [5] J.min갤로그로 이동합니다. 12.01.10 177 0
298062 게임업계는 이제 서버/그래픽 디자이너로 흘러가게 된다능... [11] ㅇㅇ(221.147) 12.01.10 215 0
298061 프로그래머될라면 어떻게함? [4] dd(175.211) 12.01.10 127 0
298060 프로그래머 돈잘범?? [4] dd(175.211) 12.01.10 197 0
298059 일 따오는 놈들이 병진이면 모두가 피곤하다 [1] 거칠게갤로그로 이동합니다. 12.01.10 90 0
298058 형들 이거 좀 도와줘 [4] YopMail갤로그로 이동합니다. 12.01.10 137 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2