디시인사이드 갤러리

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

갤러리 본문 영역

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

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 58 추천 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/03 - -
AD 저녁 뭐먹지? 오늘의 메뉴 추천! 운영자 25/10/31 - -
297918 형아들 겔러리 짤중에.....ㅠㅠ 정통27갤로그로 이동합니다. 12.01.09 36 0
297917 횽들아 요즘 자바공부하는데 상속 질문좀 할게 [8] 메리프갤로그로 이동합니다. 12.01.09 85 0
297916 슈레기 같은 SVN -=- [3] Ynobe갤로그로 이동합니다. 12.01.09 100 0
297915 형들 이거 미친짓이야?? 내 친구가 취업 안하고 있길래 뭐하냐 물어봤는데 [5] ㅁㄴㅇㄹ(59.30) 12.01.09 195 0
297913 횽들~ 넷북으로 자바/JSP/MYSQL 공부는 할수잇음? [2] 조자바(121.140) 12.01.09 300 0
297912 망하는 제품의 흔한 개발 과정.avi [4] 때릴꺼야?(116.40) 12.01.09 192 0
297911 "GDI객체를 이용한 이미지 트래킹" 기술은 어디서 배우는거임??.. [1] 제이드(175.122) 12.01.09 48 0
297910 형들 stack에서 팝 연산있잖아요 [3] SoliCode갤로그로 이동합니다. 12.01.09 53 0
297906 학원 프로젝트 고민... [6] 찹쌀뀨갤로그로 이동합니다. 12.01.09 150 0
297905 곽노현팀장 너야말로 뭔낯짝? ㅈㅈㅈ(116.125) 12.01.09 51 0
297902 성님들 ㅠㅠ 폴더안에있는 파일만 밖으로끄집어내는 방법좀알려주세요 [2] 유동찐따ㅠㅠ(14.55) 12.01.09 90 0
297901 맥 vs PC [14] ㅇㅇ(211.115) 12.01.09 129 0
297900 html 질문 드려요.. [5] html(203.171) 12.01.09 70 0
297899 C에서 fopen / 포인터 사용문제.. 어느 방법이 더 나을까요? [3] 에버리치갤로그로 이동합니다. 12.01.09 63 0
297897 DB 고수 or 프로시져에 대해서 좀 잘아는횽 소환 [7] 캐db닭(115.92) 12.01.09 99 0
297896 형들 만들고 싶은게 있는데 [4] 쒦뚫쉚뚫샒휆뚫뚫쒦갤로그로 이동합니다. 12.01.09 99 0
297895 신봉선도 꾸미기 나름이지 않음? [9] 캐미친닭(115.92) 12.01.09 159 0
297894 야 c언어 java 이런거 배우기 어렵냐? [8] 트럴성기사갤로그로 이동합니다. 12.01.09 203 0
297893 형들 질문좀용 [3] 쒦뚫쉚뚫샒휆뚫뚫쒦갤로그로 이동합니다. 12.01.09 50 0
297892 레지스트리에 관련된 질문. 솔직히 질문도 막막한데 답변주면 진짜 갓인증 [10] 한번 풀어봐(59.22) 12.01.09 88 0
297890 요즘 신봉선이 이뻐보인다. [7] 캐미친닭(115.92) 12.01.09 124 0
297889 인류의 조상이라는데? [1] 이모군(175.114) 12.01.09 86 0
횽들 이거 머가 잘못된거야? [2] 람퐈니갤로그로 이동합니다. 12.01.09 58 0
297885 월요병 극복 하는 방법 [3] ㅇㅇㅇ갤로그로 이동합니다. 12.01.09 78 0
297882 소녀시대 과거사진, CF 무리수+난감 콘셉트 '소시에게도 굴욕 과거가?' 쿄스케갤로그로 이동합니다. 12.01.09 68 0
297880 조선은 돈으로 움직이지 않는 기적같은 나라였음 [2] 1(183.104) 12.01.09 88 0
297879 에러 질문좀 아주아주 간단함 [2] 쒦뚫쉚뚫샒휆뚫뚫쒦갤로그로 이동합니다. 12.01.09 50 0
297877 내가 제일 싫어하는거 [2] 영어쓰던남자갤로그로 이동합니다. 12.01.09 74 0
297876 고액연봉인데 파워야근(최소 24시퇴근)vs 칼퇴근에 저액연봉 [10] 거칠게갤로그로 이동합니다. 12.01.09 209 0
297875 뭐든 것은 돈으로 움직이는거 같다 [1] 거칠게갤로그로 이동합니다. 12.01.09 40 0
297874 NHN이나 daum 별론가요? [4] ㅁㅁ(211.208) 12.01.09 225 0
297873 Access랑 Oracle이랑 테이블 연동 해 본 프머 있나? ㄷㄷ(112.221) 12.01.09 34 0
297872 직딩횽들 연봉 많이 올랐음?? [13] 쿄스케갤로그로 이동합니다. 12.01.09 189 0
297869 뜬금없는 인공지능 드립 [1] 1(183.104) 12.01.09 71 0
297866 밑에 온라인 핵 만들어달라고 한 사람 말야. [17] ♪♩안봉봉♬갤로그로 이동합니다. 12.01.09 207 0
297865 0xc0150002 이런 에러코드 아는갤러? Sins갤로그로 이동합니다. 12.01.09 66 0
297864 형들중에 해킹이나 보안 전문가 형들 있어? [2] 수상한김토끼갤로그로 이동합니다. 12.01.09 210 0
297862 국내업체중 개발자 직장순위를 매기면 어디가 1위임? [16] 132321(121.162) 12.01.09 368 0
297861 조깅 부작용 [3] 이모군(175.114) 12.01.09 104 0
297859 형들 자바api있잖아 [4] 플래닛댄스갤로그로 이동합니다. 12.01.09 90 0
297858 간단한 온라인게임 핵? 버그? 의뢰제작 해주실분. 보수 20만원 [6] 234(121.147) 12.01.09 2985 0
297857 형들 c# using 했는데도 네임스페이스 다 찍어야되는데 도움좀 [3] (61.75) 12.01.09 65 0
297856 갤탭을 서버로 돌려보니 [15] ㅇㅇㅇ갤로그로 이동합니다. 12.01.09 143 0
297855 언능 들어가고 싶다 Aven갤로그로 이동합니다. 12.01.09 22 0
297854 형들 게임업계가 그렇게 좃같음?? 게임업계 갈생각인데 [4] 게임업(59.30) 12.01.09 183 1
297852 제발 실력있는 웹디자이너 프리랜서 한 명만 소개시켜줘 [4] KA-1(221.155) 12.01.09 206 0
297851 아오 이제 H.264 볼 때는 PowerDVD만 써야지... [9] 분당살람갤로그로 이동합니다. 12.01.09 118 0
297850 애플릿 많이쓰여? ㅂㅈㄷ(210.178) 12.01.09 36 0
297849 괴상한 c언어 문법 질문 있습니다. [3] ㅋㅋ(121.169) 12.01.09 234 0
297847 프게이들 서류 작업 귀찮지 않냐? [3] □ㅁ갤로그로 이동합니다. 12.01.09 76 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2