디시인사이드 갤러리

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

갤러리 본문 영역

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

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 72 추천 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/17 - -
AD 대학생 필수템! What's in my Bag 운영자 25/11/21 - -
298290 USB 포멧 좀 도와줘요 ㅠ [2] 미필은고의사구갤로그로 이동합니다. 12.01.12 68 0
298289 형들 신입이 힘드네요 ㅠㅠ [7] +어게인갤로그로 이동합니다. 12.01.12 212 0
298288 횽들 나 프갤다닌다고 욕먹음 [8] 쿠마코갤로그로 이동합니다. 12.01.12 175 0
298287 뭐하나 여쭤볼게요 [1] ㅁㄴㅇㄹ(121.162) 12.01.12 53 0
298286 역시 해결사는 본좌 LISP이다... [1] ㅇㅇㅇ(221.147) 12.01.12 162 0
298282 그래픽 카드 드라이버를 못찾겠어 도와줘 ㅠㅠ [9] 그래픽(121.130) 12.01.12 140 0
298279 프갤님들 서울대 컴공과 나오면 뭐먹고살아여? [4] 흐이익(115.143) 12.01.12 318 2
298278 형들아 공유기에 대한 진지한 질문 [3] 까르갤로그로 이동합니다. 12.01.12 84 0
298276 전에는 전공하는 넘이 학원다니면 [1] dot(125.128) 12.01.12 133 0
298275 ASSA Art HTML5 , 블로그 [4] [성대아싸]갤로그로 이동합니다. 12.01.12 141 0
298273 이번에 컴공과 가는데 [22] 프갤뉴비(211.58) 12.01.12 296 0
298271 아까말한 프로젝트 결과물 ㅋㅋ [1] oxin갤로그로 이동합니다. 12.01.12 167 0
298270 아 형들 뒤에 좀넘겨보니까 나옴 [3] 123(112.166) 12.01.12 78 0
298269 저번학기에 며칠밤을 새워가면서 했던 고민 [5] oxin갤로그로 이동합니다. 12.01.12 164 0
298267 형들 cpp 책사서 공부할라고 폇는데 첨부터 에러남 ; [10] 123(112.166) 12.01.12 131 0
298261 저 아래 숙명의 카인이라는 분이 쓴거 이거 너무 웃기다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋ [5] ㅁㄴㅇㄹ(59.30) 12.01.11 243 0
298258 코딩하다 막힐 때 전라도편 [4] oxin갤로그로 이동합니다. 12.01.11 158 1
298257 좆중딩이 안드로이드 게임 개발. [5] 내가니엿가니갤로그로 이동합니다. 12.01.11 265 1
298256 형들.. 최 고령 프로그래머가 몇살임? [1] zaitsev(27.115) 12.01.11 183 0
298255 끝내주는 프론트 엔드 개발자 연봉 vs 흔한실력의 백엔드 개발자연봉 [1] 으헝(221.138) 12.01.11 453 0
298254 자바랑 씨언어중에서 [4] ㅱㅱㆁ실버갤로그로 이동합니다. 12.01.11 157 0
298253 이번 2월부터 지원하는 s/w개발병 눈독들이는 가이있나? [7] 추상화갤로그로 이동합니다. 12.01.11 198 0
298252 아 프로그래밍 어렵다. 자바가 그나마 쉽다던데 그마저도 어렵다. [9] zaitsev(27.115) 12.01.11 193 0
298251 맥북에어로 프로그래밍 가능여부 [10] 대통령칸토나(122.38) 12.01.11 991 0
298250 아이패드 케이스만 사면 도대체 무슨 의미죠 [5] ㅇㅇ(220.78) 12.01.11 86 0
298248 정신병 [7] 군대지원(222.101) 12.01.11 82 0
298245 크게기대는 안했지만..... [5] 퐈응퐈응갤로그로 이동합니다. 12.01.11 134 0
298244 윈7 가젯 참 깔끔하고 좋구나 헿헤.png ?(124.199) 12.01.11 90 0
298243 올해 2분기에 인텔CPU 안드로이드폰 나온다넹 [2] 시불라미갤로그로 이동합니다. 12.01.11 85 0
298239 프로그래밍 혼자 공부하고싶어서 그러는데 [3] ㅱㅱㆁ실버갤로그로 이동합니다. 12.01.11 123 0
298238 아 형들 나좀 도와줘 이거 이갤 년이 만든거라는디 [6] 숙명의 카인갤로그로 이동합니다. 12.01.11 5837 3
298236 형님들 자바 초보 코드입니다만....... [1] SoliCode갤로그로 이동합니다. 12.01.11 88 0
298234 웹에 미래는 어둡다. [2] 웹징징(183.105) 12.01.11 208 0
298232 기가비트랜 쓰고 싶다 [1] 노가다꾼(211.197) 12.01.11 74 0
298231 살다살다 내가 충동구매를 할줄은 몰랐네... [2] CHALLENGER갤로그로 이동합니다. 12.01.11 127 0
298230 여성부 홈페이지 해킹해서 가이포크스가면 걸어놓고 싶다 [4] 노가다꾼(211.197) 12.01.11 133 0
298229 프리랜서의 자리 [1] 자전거 타고 가자갤로그로 이동합니다. 12.01.11 146 0
298228 웹프로그래밍 답이 없어보인다 [9] 노가다꾼(211.197) 12.01.11 236 0
298226 배울게 끔찍하게 많다 웩! [1] 노가다꾼(211.197) 12.01.11 79 0
298225 쿄스케야..우리 같이 살래..? ♡ [4] 캐js닭(115.92) 12.01.11 105 0
298224 프로그래밍의 원리나 기본소양을 쌓는대 필요한 서적들 [19] CHALLENGER갤로그로 이동합니다. 12.01.11 286 0
298219 아ㅠㅠ 아무리생각해도 비참하다 [10] 개망태(182.208) 12.01.11 137 0
298218 면접 자유복장이라는데 어쩌면 좋음???????? [16] ㅁㄴㅇㄹ(115.137) 12.01.11 413 0
298217 나중에 글 하나 싸지르고 지워야징 ㅇㅇ [3] ☎v2.0™갤로그로 이동합니다. 12.01.11 79 0
298216 쓰레드 빠져나가는 걸 플래그를 썼는데요 [13] ㅋㅋㅋ(121.169) 12.01.11 120 0
298215 이거 좀 알려줘 belkin갤로그로 이동합니다. 12.01.11 56 0
298212 프로그램 개발하실분 찾고있습니다 [8] 벡사마갤로그로 이동합니다. 12.01.11 210 0
298211 프로그래밍,네트워크,서버 배우는데 도움될만한 곳♥ 김미니미갤로그로 이동합니다. 12.01.11 62 0
298209 흔한 미인의 삶.jpg [9] 쿄스케갤로그로 이동합니다. 12.01.11 291 0
298208 혹시 형들중에 c++ 프로젝트에 C# dll 낑겨 넣어서 써본 형 있음? [4] laoshanlong갤로그로 이동합니다. 12.01.11 96 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2