...

۶ مطلب در ارديبهشت ۱۳۹۴ ثبت شده است

  • ۰
  • ۰

دریافت
عنوان: جزوه درس کارآفرینی و پروژه
حجم: 1.05 مگابایت

  • حسین شفیعی
  • ۰
  • ۰

برخی دستورات Command-Line

pwd ---> print working directory --->نشان دادن آدرس دایرکتوری جاری
~ ---> hoom ---> دایرکتوری خانه
ls ---> list ---> لیستی از چیز های موجود در دایرکتوری که در آن هستیم

cd / ---> To navigate into root directory ---> رفتن به دایرکتوری ریشه
cd or cd ~ --->to navigate to your home directory ---> رفتن به دایرکتوری خانه
cd .. ---> navigate father directory ---> رفتن به دایرکتوری پدر
cd - ---> back ---> بازگشت به دایرکتوری که قبلا در آن بودیم

cd ~/address ---> رفتن به دایرکتوری که داخل دایرکتوری که در حال حاضر در آن هستیم

cd /address ---> رفتن به یک دایرکتوری
نکته : به جای آدرس نام دایرکتوری یا اگر تو در تو بود بعد از هر نام یک / قرار دهید
cp file newname ---> copy ---> کپی کردن یک فایل به جای فایل نام فایل و اسم جدید را وارد کنید
نکته:برای کپی کردن یک دایرکتوری مانند زیر عمل کنید
cp ~r directoryName newName

ادامه دارد ...
  • حسین شفیعی
  • ۱
  • ۰

دریافت
عنوان: آموزش کیوت
حجم: 4.03 مگابایت

  • حسین شفیعی
  • ۰
  • ۰
void add(int x)
{
    if(first==NULL)
    {
    node *temp=new node;
    first=temp;
    first->data=x;
    cout<<"\nEnter Name : ";
    cin>>first->name;
    first->next=NULL;
    last=first;
    }
    else
    {
    node *temp=new node;
    last->next=temp;
    last=temp;
    last->data=x;
    cout<<"\nEnter Name : ";
    cin>>last->name;
    last->next=NULL;
    }
}
void del(int y)
{
    if(y==first->data)
    {
        node *temp;
        temp=first->next;
        delete first;
        first=temp;
    }
    else if(y==last->data)
    {
        node *temp,*temp1;
        temp=temp1=first;
        while(1)
        {
            temp1=temp;
            temp=temp->next;
            if(temp==last)
            {
                delete last;
                last=temp1;
                last->next=NULL;
                break;
            }
        }
 
 
    }
    else
    {
        node *temp,*temp1;
        temp=temp1=first;
        while(1)
        {
            temp1=temp;
            temp=temp->next;
            if(temp->data==y)
            {
                temp1->next=temp->next;
                delete temp;
                break;
            }
        }
    }
     
}
void show()
 {
        node *n = first;
        while ( n ) {
            cout << n->data <<"    "<<n->name<< "\n";
            n = n->next;
        }
        cout << '\n';
         
 }
 
 
void format()
{
node *n = first;
node *e = first;
        while ( n ) {
            e=n;
            n = n->next;
            delete e;
        }
}
void searchlist(int l)
{
    node *n = first;
        while ( 1 ) {
            
            if (n->data==l)
            {
                 cout << n->data <<"    "<<n->name<< "\n";
                 break;
            }
            else
            {
            n = n->next;
            }
        }
}
  • حسین شفیعی
  • ۱
  • ۰
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
struct node
{
    int data;
    char name [30];
    char family[30];
    char number[30];
    node *next;
     
};
node *first;
node *last;
void add(int);
void del(int);
void show();
void format();
void searchlist(int);
int _tmain(int argc, _TCHAR* argv[])
{
    int ans;
    int a;
    int d;
    while(1)
    {
        cout<<"\n 1-add  2-del   3-show  4-format list  5-searchlist  (Enter |6| key to Exit) : ";
        cin>>ans;
        if(ans==1)
        {
             
            cout<<"\nEnter Number for add : ";
            cin>>a;
            add(a);
        }
        else if(ans==2)
        {
            cout<<"\nEnter Number for del : ";
            cin>>d;
            del(d);
        }
        else if (ans==3)
        {
            show();
        }
        else if (ans==4)
        {
            format();
            cout<<"END Life this linked list ";
            _getch();
            break;
        }
        else if(ans==5)
        {
            int l;
            cout<<"\nEnter Number for search : ";
            cin>>l;
            searchlist(l);
        }
        else
        {
            break;
        }
    }
    _getch();
    return 0;
}

  • حسین شفیعی
  • ۰
  • ۰

  • حسین شفیعی
تمامی حقوق این سایت طبیعتا مال همین سایته و کپی مطالب تنها با ذکر منبع مجاز می باشد