디시인사이드 갤러리

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

갤러리 본문 영역

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

람퐈니갤로그로 이동합니다. 2012.01.09 16:54:25
조회 70 추천 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 겨울가전 SALE! 쿨한 겨울 HOT세일 운영자 25/11/12 - -
298253 이번 2월부터 지원하는 s/w개발병 눈독들이는 가이있나? [7] 추상화갤로그로 이동합니다. 12.01.11 192 0
298252 아 프로그래밍 어렵다. 자바가 그나마 쉽다던데 그마저도 어렵다. [9] zaitsev(27.115) 12.01.11 186 0
298251 맥북에어로 프로그래밍 가능여부 [10] 대통령칸토나(122.38) 12.01.11 988 0
298250 아이패드 케이스만 사면 도대체 무슨 의미죠 [5] ㅇㅇ(220.78) 12.01.11 82 0
298248 정신병 [7] 군대지원(222.101) 12.01.11 77 0
298245 크게기대는 안했지만..... [5] 퐈응퐈응갤로그로 이동합니다. 12.01.11 132 0
298244 윈7 가젯 참 깔끔하고 좋구나 헿헤.png ?(124.199) 12.01.11 85 0
298243 올해 2분기에 인텔CPU 안드로이드폰 나온다넹 [2] 시불라미갤로그로 이동합니다. 12.01.11 82 0
298239 프로그래밍 혼자 공부하고싶어서 그러는데 [3] ㅱㅱㆁ실버갤로그로 이동합니다. 12.01.11 116 0
298238 아 형들 나좀 도와줘 이거 이갤 년이 만든거라는디 [6] 숙명의 카인갤로그로 이동합니다. 12.01.11 5833 3
298236 형님들 자바 초보 코드입니다만....... [1] SoliCode갤로그로 이동합니다. 12.01.11 81 0
298234 웹에 미래는 어둡다. [2] 웹징징(183.105) 12.01.11 203 0
298232 기가비트랜 쓰고 싶다 [1] 노가다꾼(211.197) 12.01.11 64 0
298231 살다살다 내가 충동구매를 할줄은 몰랐네... [2] CHALLENGER갤로그로 이동합니다. 12.01.11 117 0
298230 여성부 홈페이지 해킹해서 가이포크스가면 걸어놓고 싶다 [4] 노가다꾼(211.197) 12.01.11 130 0
298229 프리랜서의 자리 [1] 자전거 타고 가자갤로그로 이동합니다. 12.01.11 138 0
298228 웹프로그래밍 답이 없어보인다 [9] 노가다꾼(211.197) 12.01.11 234 0
298226 배울게 끔찍하게 많다 웩! [1] 노가다꾼(211.197) 12.01.11 76 0
298225 쿄스케야..우리 같이 살래..? ♡ [4] 캐js닭(115.92) 12.01.11 102 0
298224 프로그래밍의 원리나 기본소양을 쌓는대 필요한 서적들 [19] CHALLENGER갤로그로 이동합니다. 12.01.11 282 0
298219 아ㅠㅠ 아무리생각해도 비참하다 [10] 개망태(182.208) 12.01.11 135 0
298218 면접 자유복장이라는데 어쩌면 좋음???????? [16] ㅁㄴㅇㄹ(115.137) 12.01.11 411 0
298217 나중에 글 하나 싸지르고 지워야징 ㅇㅇ [3] ☎v2.0™갤로그로 이동합니다. 12.01.11 75 0
298216 쓰레드 빠져나가는 걸 플래그를 썼는데요 [13] ㅋㅋㅋ(121.169) 12.01.11 114 0
298215 이거 좀 알려줘 belkin갤로그로 이동합니다. 12.01.11 54 0
298212 프로그램 개발하실분 찾고있습니다 [8] 벡사마갤로그로 이동합니다. 12.01.11 204 0
298211 프로그래밍,네트워크,서버 배우는데 도움될만한 곳♥ 김미니미갤로그로 이동합니다. 12.01.11 60 0
298209 흔한 미인의 삶.jpg [9] 쿄스케갤로그로 이동합니다. 12.01.11 281 0
298208 혹시 형들중에 c++ 프로젝트에 C# dll 낑겨 넣어서 써본 형 있음? [4] laoshanlong갤로그로 이동합니다. 12.01.11 90 0
298206 형들 학사특례 TO가 정확히 뭐지? [2] 으아니(211.234) 12.01.11 83 0
298205 야~ 리눅스에서 tomcat 돌려 본 사람? [2] 개심심(61.73) 12.01.11 88 0
298204 if 문 쓸때 질문 [4] ㅇㅇㅇ갤로그로 이동합니다. 12.01.11 76 0
298202 for vs while [4] ☎v2.0™갤로그로 이동합니다. 12.01.11 136 0
298201 아...외쿸 포럼에서 제대로 활동하려구 가입했는데... [9] 캐js닭(115.92) 12.01.11 129 0
298200 MFC책 추천좀 1(183.104) 12.01.11 100 0
298198 winapi 배울 필요 없이 바로 MFC가야함? [4] 1(183.104) 12.01.11 122 0
298197 최근 본 짤 중에 젤웃기닼ㅋㅋㅋㅋㅋㅋㅋㅋ [7] McHello갤로그로 이동합니다. 12.01.11 263 0
298196 형들 KLDP에 대해 어떻게 생각하시나요? [4] 940408(175.252) 12.01.11 135 0
298193 부트 로더 부분 보고 링크 기능 좀 이해하면.... [15] ☎v2.0™갤로그로 이동합니다. 12.01.11 132 0
298192 오늘 포인터 공부할거야 횽들!! [3] 쿠마코갤로그로 이동합니다. 12.01.11 79 0
298191 비밀번호 설정한 걸 보니...해킹돼도 할말 없다! [3] 소식인(58.150) 12.01.11 87 0
298190 아래꺼 답좀 해주세요.. 질문(211.114) 12.01.11 25 0
298189 c# Dictionary 객체의 Key값 바꿀수있어? [1] 해물(61.81) 12.01.11 99 0
298188 C 싱글링크드리스트에 관련된 질문.. [15] 질문(211.114) 12.01.11 107 0
298187 동영상 인코딩서버를 세팅하고있는데 맥콜(112.223) 12.01.11 71 0
298185 게임제작기 .. 좌파로부터 전염 캐릭터설정중 도와줘형들 [16] 싴보이갤로그로 이동합니다. 12.01.11 185 0
298184 테스트글) 프로그래밍 진화 ㅇㅇㅇ(121.144) 12.01.11 74 0
298183 형들 자료구조에서..... [2] SoliCode갤로그로 이동합니다. 12.01.11 75 0
298181 아오 개발할수록 영어의 중요성을 느끼게 된다. [1] 개떙보갤로그로 이동합니다. 12.01.11 120 0
298180 횽들 프로그램좀 봐줘 [1] 그냥폐인갤로그로 이동합니다. 12.01.11 81 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2