-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.C
55 lines (45 loc) · 1.13 KB
/
string.C
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
void string()
{
static char *par[] = {
"Gamma",
"Positron",
"Electron",
"neutrino"
};
static char *pname[] = {
" Gamma ", " e^+ ", " e^- ", "Neutrino", " Muon^+ ",
" Muon^- ", " Pion^0 ", " Pion^+", " Pion^- ", " Kaon^0L",
" Kaon^+ ", " Kaon^- ", "Neutron", "Proton", "A-Proton",
" Kaon^0S", " Eta ", " Lambda ", " Sigma^+ ", "Sigma^0",
" Sigma^-", " Xi^0 ", " Xi^- ", " Omega", "A-Neutron",
};
for(int i = 0; i<4;i++)
{
// cout << par[i] << endl;
printf(" %19s ",par[i]);
}
for(int i = 0; i<14;i++)
{
// cout << par[i] << endl;
printf(" %19s \n",pname[i]);
}
int pct = 37;
char filename[] = "foo.txt";
printf ("Processing of `%s' is %d%% finished.\nPlease be patient.\n",
filename, pct);
//sprintf-----------
Char_t *st1;
Char_t *st2;
Char_t *st3;
Char_t *st4;
Char_t title[120];
if(1 > 2)
st1 = "satya";
else
st1 = "satyajit";
st2 = "any thing";
st3 = " Nothing";
st4 = "Everything";
sprintf(title,"%s of ( %s Type ) %s %s Events",st3,st1,st2,st4);
cout<<title<<endl;
}