Repository navigation
Expand file tree
/
Copy pathfunction.cpp
More file actions
81 lines (75 loc) · 1.47 KB
/
Copy pathfunction.cpp
File metadata and controls
81 lines (75 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// in cpp the main function return the int value to the o.p system
// int main(int argc , char * argv[])
// argc=num of the argument
// argv= arguments
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstdarg>
using namespace std;
// void swap(int &a, int &b){ // call by reference
// int t;
// t=a;
// a=b;
// b=t;
// }
// int main(){
// int a,b;
// cin>>a>>b;
// swap(a,b);
// cout<<a<<b;
// }
// function using ellipse
//// erroe haii
// int max(int c,...){
// va_list arg;
// va_start(arg,c);
// int m=va_arg(arg,int);
// for(int arg=0;arg<c;arg++){
// if(va_arg(arg,int)>m)
// m=va_arg(arg,int);
// }
// va_end(arg);
// return m;
// }
// int main(){
// cout<<max(3,1,2,3)<<endl;
// cout<<max(5,2,6,4,3,9);
// }
// int &max(int &a,int &b){
// if(a>b)
// return a;
// else
// return b;
// }
// int main(){
// int n,m;
// cin>>n>>m;
// //cout<<max(n,m);
// if(max(n,m)%2==0){
// max(n,m)*=2;
// }
// else
// max(n,m)+=1;
// cout<<max(n,m);
// }
// tower of hnoi
// void toh(int n,char srs,char help,char dest)
// {
// if(n==0)
// return;
// else
// {
// toh(n-1,srs,dest,help);
// cout<<"move to the "<<srs<<"to the"<<help<<endl;
// toh(n-1,dest,help,srs);
// }
// }
// int main(){
// int n;
// cin>>n;
// toh(n,'A','B','C');
// }