'Code'에 해당되는 글 30건

  1. 2011.09.03 [ALGORISM]poj 1166
  2. 2011.09.03 [ALGORISM]poj 1218
  3. 2011.09.03 [ALGORISM]poj 1298
  4. 2011.09.03 [ALGORISM]poj 2853
  5. 2011.09.03 [ALGORISM]poj 1077
  6. 2011.09.03 [ALGORISM]poj 1163
  7. 2011.09.03 [ALGORISM]poj 1003
  8. 2011.09.03 [ALGORISM] poj 3085
  9. 2011.09.03 [html+php+mysql]홈페이지 만들기. 10
  10. 2011.08.29 [Code] 유클리드 알고리즘(Euclid Algorism)
2011. 9. 3. 14:48

//poj 1166
//2011 07 04
//daun
#include <iostream>
using namespace std;

void swap(int *a,int *b)
{
 int temp = *a;
 *a = *b;
 *b = temp;
}

int main()
{
 int arr[3][3]={0};
 int i = 0;
 int end = 0;
 int result[27] ={0};
 int count = 0;

 for(int a = 0 ; a< 3 ; a++)
  for(int b = 0 ; b< 3; b++)
   cin>>arr[a][b];
 while(end!=9)
 {
  end = 0;
  if(arr[0][1]* arr[1][0] *arr[1][1]* arr[1][2] * arr[2][1] )
  {
   arr[0][1]++;
   arr[1][0]++;
   arr[1][1]++;
   arr[1][2]++;
   arr[2][1]++;
   result[count] = 5;
  }
  else
  {
   if(!arr[i][1])
   {
    if(!arr[1][i])
     i++;
   }
   else if(!arr[i][0])
   {
    arr[i][1]++;
    arr[i][2]++;
    arr[i+1][1]++;
    arr[i+1][2]++;
    if(i == 0)
     result[count] = 3;
    if(i == 1)
     result[count] = 9;
   }
   else if(!arr[i][2])
   {
    arr[i][0]++;
    arr[i][1]++;
    arr[i+1][0]++;
    arr[i+1][1]++;
    if(i == 0)
     result[count] = 1;
    if(i == 1)
     result[count] = 7;
   }
   if(arr[i][0]*arr[i][1]* arr[i][2])
   {
    arr[i][0]++;
    arr[i][1]++;
    arr[i][2]++;
    if(i == 0)
     result[count] = 2;
    else
     result[count] = 8;
   }

   if(arr[0][i]* arr[1][i] * arr[2][i] )
   {
    arr[0][i]++;
    arr[1][i]++;
    arr[2][i]++;
    if(i == 0)
     result[count] = 4;
    else
     result[count] = 6;
   }
  } 

  for(int a = 0; a < 3 ; a++)
   for(int b= 0 ; b< 3; b++)
   {
    if(arr[a][b] >=4)
     arr[a][b] = arr[a][b]%4;
    if(arr[a][b] == 0)
     end++;
   }
   if(result[count])
  count++;

 }
 
 for(int a = 1; a<count; a++)
  for(int b = a; b<count; b++)
  if(result[b]<result[b-1])
  {
   int temp = result[b-1];
   result[b-1] = result[b];
   result[b]= temp;
  }

 for(int a = 0 ; a < count; a++)
  cout << result[a] << "\t";

 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1218  (0) 2011.09.03
[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:48

//2011 07 05
//poj 1218
//daun
#include <iostream>
using namespace std;

int main()
{
 int cell=0;
 int count = 0;
 int number = 0;
 cin>>count;
 for(;count>0;count--)
 {
  number = 0;
 bool arr[101] = {0}; // 0이 열린거 1이 닫힌거

  cin >> cell;

  for(int i = 1 ; i <=cell; i++)
  {
   for(int a = 1 ; a <=cell ; a++)
   {
    if(a%i == 0)
    {
     if(!arr[a])
      arr[a] = 1;
     else if(arr[a])
      arr[a] = 0;
    }
   }
  }

  for(int i = 1 ; i <=cell; i++)
   if(arr[i])
    number ++;

  cout << number<<endl;
 }
 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1166  (0) 2011.09.03
[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:47

//2011 07 02
//POJ 1298
//The Hardest Problem Ever


//1~200자의 문자를 받음 옆으로 5칸씩 -> 아스키코드 이용하여 출력
//int 배열로 받고, 끝나는거 확인하구 입력은... 아 끝나는게 문제구나

#include <iostream>
#include <string>
using namespace std;

int main()
{
 string strStart, strEnd;
 string strIn[100];
 int i = 0;
 getline(cin,strStart) ;

 while(strStart != "ENDOFINPUT")
 {
  getline(cin,strIn[i]);
  for(int a = 0 ; a < strIn[i].length()  ; a++)
  {
   if(strIn[i][a] >= 65 && strIn[i][a] <=90)
   {
    strIn[i][a] -= 5;
    if(strIn[i][a] < 65 && strIn[i][a] >=60)
     strIn[i][a] += 26;
   }
  }
  getline(cin,strEnd);
  i++;
  getline(cin,strStart) ;
 }


 for(int a= 0 ; a <i ; a++)
 {
  cout << strIn[a];
  cout << endl;
 }
 system("pause");
 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1166  (0) 2011.09.03
[ALGORISM]poj 1218  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:47


//2011 07 05
//poj 2853
//daun
#include <iostream>
using namespace std;

int main()
{
 int count = 0;
 int number = 0;
 int answer = 0;
 int i = 0;
 int sum = 0;
 cin >> count;
 while(i!=count)
 {
  cin >> i;
  sum = 0;
  answer = 0;
  cin >> number;
  for(int a = number; a> 0 ; a--)
  {
   sum = a;
   for(int b = a -1; b > 0 ; b--)
   {
    sum+=b;
    if(sum ==  number)
     answer++;
   }
  }
  cout <<i<<" " << answer << endl;
 }
 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1218  (0) 2011.09.03
[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
[ALGORISM]poj 1003  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:46


//http://poj.org/problem?id=1077
//Eight
//daun

#include <iostream>
#include <conio.h>
#include <winsock2.h>
#include <time.h>
#include <stdio.h>

using namespace std;

enum {BLACK,D_BLUE,D_GREEN,D_SKYBLUE,D_RED,D_VIOLET,D_YELLOW,GRAY,D_GRAY,BLUE,GREEN,SKYBLUE,RED,VIOLET,YELLOW,WHITE,};


void exchange(int *pa, int *pb);
void show(int[][4]);
void SetColor(int backcolor, int fontcolor);
int answer(int arr[][4]);
void start(int *pa, int *pb, int arr[][4]);

int main()
{
 srand(time(NULL));

 system("color F0");
 char type;
 int arr[4][4] = {0};
 int x =0, y=0 ;
 
 start(&x,&y,arr);


 while(1)
 {
  SetColor(WHITE,VIOLET);
  cout <<"\n\n UP : U or u, DOWN : J or j, RIGHT : K or k, LEFT : H or h"<<endl;
  cout <<"\nIf you want to quit, Press the Z or z \n\n"<<endl;
  show(arr);
  switch(type=getch())
  {
  case 'U':
  case 'u':
   if((x-1)>=0)
    exchange(&arr[x][y],&arr[x--][y]);
   else
   {
    SetColor(WHITE,RED);
    cout <<"\nCan't move"<<endl;
   }
   break;
  case 'J':
  case 'j':
   if((x+1)<=3)
    exchange(&arr[x][y],&arr[x++][y]);
   else
   {
    SetColor(WHITE,RED);
    cout<<"\nCan't move"<<endl;
   }
   break;
   case 'K':
   case 'k':
   if((y+1)<=3)
    exchange(&arr[x][y],&arr[x][y++]);
   else
   {
    SetColor(WHITE,RED);
    cout<<"\nCan't move"<<endl;
   }
   break;
  case 'H':
  case 'h':
   if((y-1)>=0)
    exchange(&arr[x][y],&arr[x][y--]);
   else
   {
    SetColor(WHITE,RED);
    cout<<"\nCan't move"<<endl;
   }
   break;
  case 'z':
  case 'Z':
   return 0;
  default:
   SetColor(WHITE,RED);
   cout<<"\nYou press wrong key"<<endl;
  }
  if(answer(arr)==16)
  {
   cout<<"Enswer!!!";
   return 0;
  }
    Sleep(10);
   system("cls");

  
 }


 return 0;

}
void exchange(int *pa, int *pb)
{
 int temp;
 temp = *pa;
 *pa = *pb;
 *pb = temp;
}

void show(int arr[][4])
{
 SetColor(WHITE,BLACK);
 for(int a = 0; a < 4 ; a++)
 {
  for(int b = 0 ; b <4 ; b++)
  {
   if(arr[a][b]==16)
    cout<< 'X' <<"\t";
   else
    cout << arr[a][b] << "\t";
  }
  cout << endl;
 }
}

void SetColor(int backcolor, int fontcolor)
{
 SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), backcolor*16+fontcolor);
}

int answer(int arr[][4])
{
 int count=1;
 for(int a = 0 ; a < 4; a++)
  for(int b = 0; b<4 ; b++)
   if(arr[a][b]==count)
    count++;

 return count;

}

void start(int *pa, int *pb, int arr[][4])
{
  for(int i = 1 ; i < 17; i++)
 {
  while(1)
  {
   *pa = rand()%4;
   *pb = rand()%4;

   if(arr[*pa][*pb])
    continue;

   arr[*pa][*pb]=i;
   break;
  }
 }
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
[ALGORISM]poj 1003  (0) 2011.09.03
[ALGORISM] poj 3085  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:46


//2011.07.01
//Daun.
//POJ 1163 The Triangle

#include <iostream>
#include <string.h>
#include <stdlib.h>

using namespace std;

int result = 0;

void leftSum(int [][100], int , int ,int); //왼쪽 대각선 아래를 더하는 경우
void rightSum(int [][100], int , int , int); //오른쪽 대각선 아래를 더하는 경우

int main()
{
 int line=1;
 int arr[100][100]= {0};

 memset(arr,-1,sizeof(arr));


 cin >> line;
 //줄수를 입력받음

 for(int a = 0 ; a < line ; a++)
  for(int b = 0 ; b <= a; b++)
   cin>>arr[a][b];
  
 //숫자를 입력 받음

 rightSum(arr,0,0,0);
 leftSum(arr,0,0,0);

 cout << result;

 system("pause");

 return 0;
}

void rightSum(int arr[][100], int a, int b ,int sum)
{
 if(arr[a][b] == -1)
 {
  if( sum > result)
   result = sum;
 }
 else
 {
 sum+=arr[a][b];
 rightSum(arr,a+1,b+1,sum);
 leftSum(arr,a+1,b,sum);
 }
}

void leftSum(int arr[][100], int a , int b,int sum)
{
 if(arr[a][b] == -1)
 {
  if(sum > result)
  result = sum;
 
 }
 
 else
 {
 sum+=arr[a][b];
 leftSum(arr,a+1,b ,sum);
 rightSum(arr,a+1,b+1,sum);
 }
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1003  (0) 2011.09.03
[ALGORISM] poj 3085  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:45

// 2011 07 03
// poj 1003
//daun

#include <iostream>
#include <math.h>

using namespace std;


int main()
{
 double sum = 0;

 double length = 0;
 cin >> length;

 while(length != 0)
 {
  sum = 0;
  for(int a = 2 ; ; a++)
  {
   sum += (1/(double)a);

   if(length-sum <0)
   {
    cout << a-1 <<" card(s)"<<endl;
    break;
   }
  }

  cin >> length;
 }
 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
[ALGORISM] poj 3085  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 14:45

//2011 07 06
//poj 3085
//daun
#include <iostream>
using namespace std;

int main()
{
 int QUARTER =0 , DIME = 0, NICKEL = 0, PENNY = 0 ;
 int count = 0;
 int money = 0;
cin >> count;
 for(int i = 1 ; i<=count; i++)
 {
  cin >> money;
  QUARTER = money/25;
  money -= QUARTER * 25;
  DIME = money/10;
  money -= DIME * 10;
  NICKEL = money/5;
  money -= NICKEL * 5;
  PENNY = money/1;
  
  cout << i<<" "<<QUARTER<<" QUARTER(S), "<< DIME <<" DIME(S), "<<NICKEL<<" NICKEL(S), "<<PENNY<<" PENNY(S)"<<endl;


 }

 return 0;
}

'Code > Algorism' 카테고리의 다른 글

[ALGORISM]poj 1298  (0) 2011.09.03
[ALGORISM]poj 2853  (0) 2011.09.03
[ALGORISM]poj 1077  (0) 2011.09.03
[ALGORISM]poj 1163  (0) 2011.09.03
[ALGORISM]poj 1003  (0) 2011.09.03
Posted by I_co
2011. 9. 3. 00:35

만든이 : i_co
            Daun..
           2011 09 02.


폴더트리가 이렇게 되어야 합니다.
htdocs -(폴더)homepage - (폴더) login - dbcon.php
                                                              - login.html
                                                               - login.php
                                                              - loginJoin.html
                                                               - loginJoin.php
                                        - (폴더) board - board.php
                                                               - boardRead.php
                                                                - boardWrite.html
                                                                -boardWrite.php
                                                                 - dbcon.php
                                        - homepage.html
                                       - menu.html
           

dbcon.php

<?
 $dbc = mysql_connect("localhost","root","apmsetup");
 mysql_select_db("homepage");
?>

login.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
   <form method = "get" action = "login.php">

 <table>
 <tr>
 <td>
  아 이 디 :
 </td>
 <td>
  <input type = "text" name = "id">
 </td>
 </tr>
 <tr>
 <td>
  비 밀 번 호 :
 </td>
 <td>
  <input type = "password" name = "password">
 </td>
 </tr>
 <tr>
 <td>
   <input type = "submit" value = "로그인">
   </form>
 </td>
 <td>
   <form method = "get" action = "loginJoin.html">
   <input type = "submit" value = "회원가입">
   </form>
 </td>
 </tr>

 </table>

 
 </BODY>
</HTML>

login.php

<?php
include 'dbcon.php';

$ID = $_GET['id'];
$PASSWORD = $_GET['password'];

$query = "SELECT * FROM login";
$result = mysql_query($query);

while($row = mysql_fetch_array($result))
{
 $correct = 0;
 $dbid = $row['id'];
 $dbpassword = $row['password'];

 if($ID == $dbid)
 { 
  if($dbpassword == $PASSWORD)
  {
   $correct=1;
   break;
  }
 }
}
 if($correct == 0)
 {
 ?>
  <script language = "javascript">
  <!--
   window.location = "login.html";
   alert("아이디를 잘못 입력하셧습니다.");
  //-->

  </script>
  <?php
 }
 else
  echo("로그인 완료");
 
?>

loginJoin.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
 <form action = "loginJoin.php" method = "get">
  <table>
  <tr>
   <td>
    아이디 :
   </td>
   <td>
    <input type = "text" name = "id">
   </td>
  </tr>
  <tr>
   <td>
    비밀번호 :
   </td>
   <td>
    <input type = "text" name = "password">
   </td>
  </tr>
  <tr>
   <td>
     <input type = "submit" value = "작성완료">
   </td>
   <td>
    <input type = "reset" value = "다시작성">
   </td>
  </tr>
  </table>
  </form>
 </BODY>
</HTML>

loginJoin.php

<?php
include 'dbcon.php';

$ID = $_GET['id'];
$PASSWORD = $_GET['password'];

$query = "INSERT INTO login VALUE('$ID','$PASSWORD')";
mysql_query($query);

?>
<script language = "javascript">
window.location = "login.html"
alert = ("회원가입 완료. 다시 로그인 해주세요.");
</script>

board.php

<?php
include 'dbcon.php'
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <h1>게시판 </h1>
  - 게시판 입니다.

  <table>
 <tr>
  <td width = "80">
   글 번호
  </td>
  <td width = "300">
   글 제목
  </td> 
  <td width = "80">
   글쓴이
  </td>
 </tr>
 <?php
  $query = "SELECT * FROM board ORDER BY number DESC";
  $result = mysql_query($query);
  while($row = mysql_fetch_array($result))
  {
   $number = $row['number'];
   $title = $row['title'];
   $name = $row['name'];
   echo("<tr><td>$number</td><td><a href = 'http://localhost/homepage/board/boardRead.php?number=$number'>$title</a></td><td>$name</td></tr>");
  }
 ?>
 <form method = "post" action = "boardWrite.html">
  <input type = "submit" value = "글쓰기">
 </form>
  </table>
 </BODY>
</HTML>

boardRead.php

<?php
 include 'dbcon.php';
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
 <?php
 $NUMBER = $_GET['number'];
$query = "SELECT * FROM board where number='$NUMBER'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$number = $row['number'];
$title = $row['title'];
$name = $row['name'];
$text = $row['text'];
 ?>

 <h1>
 글 읽기
 </h1>
 <table>
 <tr>
  <td>
   글번호 :
  </td>
  <td>
   <?php echo("$number")?>
  </td>
 </tr>
 <tr>
  <td>
   제목 :
  </td>
  <td>
    <?php echo("$title")?>
  </td>
 </tr>
 <tr>
  <td>
   글쓴이 :
  </td>
  <td>
   <?php echo("$name")?>
  </td>
 </tr>
 <tr>
  <td>
   내용 :
  </td>
  <td>
   <?php echo("$text")?>
  </td>
 </tr>
 </table>
 
 </BODY>
</HTML>

boardWrite.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <h1>
 글쓰기
  </h1>
  -글을 쓰는 페이지 입니다.
 <form action = "boardWrite.php" method = "get">

  <table>
  <tr>
 <td>
  제목
 </td>
 <td>
  <input type = "text" name = "title" value = "제목을적으세요" maxlength = "30">
 </td>
  </tr>
  <tr>
 <td>
  작성자
 </td>
 <td>
  <input type = "text" name = "name" value = "이름" maxlength = "10">
 </td>
  </tr>
  <tr>
 <td>
  글 내용
 </td>
 <td>
  <textarea cols = 80" rows = "40" name = "text">
  입력해주세요
  </textarea>
 </td>
  </tr>
  <tr>
 <td>
  <input type = "submit" value = "작성완료">
 </td>
 <td>
 <input type = "reset" value = "다시작성">
 </td>
  </tr>
  </table>
  </form>
 </BODY>
</HTML>

boardWrite.php

<?php
 include 'dbcon.php';

 $TITLE = $_GET['title'];
 $NAME = $_GET['name'];
 $TEXT = $_GET['text'];
 
 $query = "SELECT * FROM board  ORDER BY number DESC";
 $result = mysql_query($query);
 $row = mysql_fetch_array($result);
 
 $NUMBER = $row['number'];

 $NUMBER++;
 $query = "INSERT INTO board VALUE('$NUMBER','$TITLE','$NAME','$TEXT')";
 mysql_query($query);
?>
<html>
<body>
<script language = "javascript">
window.location="board.php"
</script>
</body>
</html>

homepage.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

<frameset rows = "50,*" border = "0" noresize>
 <frame name = "title">
 <frameset cols = "400,*">
  <frameset rows = "150,*">
   <frame src = "login/login.html" name = "login">
   <frame name = "ad">
  </frameset>
  <frameset rows = "100,*">
   <frame src = "menu.html" name = "menu">
   <frame name = "middle">
  </frameset>
 </frameset>
</frameset>
</HTML>

menu.html


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
  <TITLE> New Document </TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
 </HEAD>

 <BODY>
  <a href = "board/board.php" target = "middle">
 게시판
  </a>
 </BODY>
</HTML>





--------------------------

애초에 나름 심혈을 기울여서 만든거는 다 훌렁훌렁 포맷과 함께 날려버리고
결국 하루를 다시 더 투자하여 복구해놓은것..
기타 그냥 링크따위는 중요한거 같지 않아서

그냥 게시판과 로그인 기능만 만들었다.

javascript와 css를 아직 사용하지 않은 것이 걸리지만..

홈페이지를 두번이나 만들면서 진을 다 뺀거 같기에..
당분간 보류..
조만간 수정을 보게되면 좀더 이쁜 홈페이지로 돌아오겟지..

여기서 실행시켜야할것은 homepage.html입니다~!!

get타입이라 보완에 취약.

mysql이용~!
database homepage;
create table board(number int, title varchar(30),name varchar(10),text varchar(3200));
create table login(id varchar(10),password varchar(20));
insert into board values('0','hello','daun','heloo');
가 DB에 선언되어 있어야함.!

'Code > web' 카테고리의 다른 글

[web]php 쿠키설정  (0) 2012.01.21
Posted by I_co
2011. 8. 29. 01:21

//2011 08 28
//유클리드 알고리즘 구현하기
//Daun..
//I_co@IGRUS

#include <iostream>
using namespace std;

void swap(int,int);
int GCD(int,int);

int main()
{
 int num1=0, num2 = 0;

 cout << "두개의 숫자를 입력해 주세요\n";
 cin >> num1>>num2;

 cout << GCD(num1,num2);
 return 0;
}
void swap(int *a, int *b)
{
 int temp;
 temp = *a;
 *a = *b;
 *b = temp;
}
int GCD(int num1, int num2)
{
 if(num1<num2)
  swap(num1,num2);

 if(num2)
 {
  GCD(num2, num1-num2);
 }
 else
 {
  return num1;
 }
}

 

'Code > c/c++' 카테고리의 다른 글

[C++]Game of Snake.  (0) 2011.09.03
[C++]poker  (0) 2011.09.03
[C++ Code]Swap  (0) 2011.07.28
[C++ Code]주소값출력하기  (0) 2011.07.28
[C++ Code]재귀함수  (0) 2011.07.28
Posted by I_co