Skip to content

Commit 551d959

Browse files
Update possible no from word.cpp
I think because of stl it is running perfect in my laptop so now try this it is fine
1 parent f2ac70f commit 551d959

File tree

1 file changed

+5
-49
lines changed

1 file changed

+5
-49
lines changed

General Questions/possible no from word.cpp

Lines changed: 5 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,7 @@ INPUT-
66
1234-the given number
77
OUTPUT-
88
One thousand Two hundred and twenty four */
9-
10-
#include <bits/stdc++.h>
11-
#define ff first
12-
#define ss second
13-
#define int long long
14-
#define pb push_back
15-
#define mp make_pair
16-
#define pii pair<int,int>
17-
#define vi vector<int>
18-
#define mii map<int,int>
19-
#define pqb priority_queue<int>
20-
#define pqs priority_queue<int,vi,greater<int> >
21-
#define setbits(x) __builtin_popcountll(x)
22-
#define zrobits(x) __builtin_ctzll(x)
23-
#define mod 1000000007
24-
#define inf LONG_LONG_MAX
25-
#define ps(x,y) fixed<<setprecision(y)<<x
26-
#define endl '\n'
27-
#define mk(arr,n,type) type *arr=new type[n]
28-
#define w(x) int x; cin >> x; while(x--)
29-
#define f(i,x,y) for(int i = x; i < y; i++)
30-
#define g(i,x,y) for(int i = x;i<=y;i++)
31-
32-
33-
9+
#include<bits/stdc++.h>
3410
using namespace std;
3511
string one[] = { "", "one ", "two ", "three ", "four ",
3612
"five ", "six ", "seven ", "eight ",
@@ -44,14 +20,6 @@ string one[] = { "", "one ", "two ", "three ", "four ",
4420
string ten[] = { "", "", "twenty ", "thirty ", "forty ",
4521
"fifty ", "sixty ", "seventy ", "eighty ",
4622
"ninety " };
47-
48-
49-
50-
void c_p_p()
51-
{
52-
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
53-
54-
}
5523
/* ******* Your Functions Below ******** */
5624

5725

@@ -101,35 +69,23 @@ string convertToWords(long n)
10169

10270
return out;
10371
}
104-
105-
/* ******* Your Functions Above ******** */
106-
107-
int32_t main()
72+
int main()
10873
{
109-
c_p_p();
110-
#ifndef ONLINE_JUDGE
111-
// For getting input from input.txt file
112-
// For getting input from input.txt file
113-
freopen("inpute.exe", "r", stdin);
114-
115-
// Printing the Output to output.txt file
116-
freopen("output.exe", "w", stdout);
117-
#endif
11874
int t;
11975
cin>>t;
120-
76+
12177
while(t--)
12278
{
12379
long n ;
12480
cin>>n;
12581

12682
// convert given number in words
12783
cout << convertToWords(n) << endl;
128-
84+
12985

13086
}
131-
return 0;
13287
}
88+
13389
/*Time complexity:
13490
Time complexity: O(1).
13591
The loop runs for a constant amount of time.

0 commit comments

Comments
 (0)