Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Check Case
- #include<iostream>
- using namespace std;
- int main() {
- // Write your code here
- char a;
- cin>>a;
- if(a>='A' && a<='Z')
- cout<<"1";
- else if(a>='a'&&a<='z')
- cout<<"0";
- else
- cout<<"-1";
- return 0;
- }
- Number Pattern 1
- #include<iostream>
- using namespace std;
- int main(){
- /* Read input as specified in the question.
- * Print output as specified in the question.
- */int n,temp=1;
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- temp=i;
- for(int j=1;j<=i;j++)
- {
- cout<<temp;
- temp++;
- }
- cout<<'\n';
- }
- return 0;
- }
- #include<iostream>
- using namespace std;
- int main(){
- /* Read input as specified in the question.
- * Print output as specified in the question.
- */
- int n,temp;
- cin>>n;
- for(int i=1;i<=n;i++)
- {
- for(int j=i;j<=n-1;j++)
- cout<<' ';
- temp=i;
- for(int j=1;j<=i;j++)
- {
- cout<<temp;
- temp++;
- }
- cout<<'\n';
- }
- }
- #include<iostream>
- using namespace std;
- int main()
- {
- int n,temp=1;
- cin>>n;
- for(int i=0;i<n;i++)
- {
- for(int j=1;j<n-i;j++)
- cout<<' ';
- for(int j=1;j<=temp;j++)
- cout<<'*';
- temp+=2;
- cout<<'\n';
- }
- return 0;
- }
- /*Code by Surya a.k.a Sunny*/
- /* by https://www.codechef.com/users/spsc */
- #include <bits/stdc++.h>
- //#include <boost/multiprecision/cpp_int.hpp>
- #define lli long long
- #define pi 3.14159265358979323846
- #define MOD 1000000007
- #define unbuffer cin.clear(); cin.sync();
- #define foi(n) for(lli i=0;i<n;i++)
- #define foj(n) for(lli j=0;j<n;j++)
- #define test(T) lli T;cin>>T;while(T--)
- #define loop(i, a, b) for(int i = (a); i<= (b); i++)
- using namespace std;
- //using namespace boost::multiprecision;
- int main()
- {
- lli basic,ans2;
- char grade;
- double hra,df,pf,ans;
- cin>>basic>>grade;
- hra=(.20)*basic;
- df=(.50)*basic;
- pf=(.11)*basic;
- ans=basic+hra+df-pf;
- if(grade=='A')
- ans+=1700;
- else if(grade=='B')
- ans+=1500;
- else
- ans+=1300;
- ans2=round(ans);
- cout<<ans2;
- }
- /*Code by Surya a.k.a Sunny*/
- /* by https://www.codechef.com/users/spsc */
- #include <bits/stdc++.h>
- //#include <boost/multiprecision/cpp_int.hpp>
- #define lli long long
- #define pi 3.14159265358979323846
- #define MOD 1000000007
- #define unbuffer cin.clear(); cin.sync();
- #define foi(n) for(lli i=0;i<n;i++)
- #define foj(n) for(lli j=0;j<n;j++)
- #define test(T) lli T;cin>>T;while(T--)
- #define loop(i, a, b) for(int i = (a); i<= (b); i++)
- using namespace std;
- //using namespace boost::multiprecision;
- int main()
- {
- int n,temp,odd=0,even=0;
- cin>>n;
- while(n!=0)
- {
- temp=n%10;
- if(temp%2)
- odd+=temp;
- else
- even+=temp;
- n/=10;
- }
- cout<<even<<' '<<odd;
- return 0;
- }
- /*Code by Surya a.k.a Sunny*/
- /* by https://www.codechef.com/users/spsc */
- #include <bits/stdc++.h>
- //#include <boost/multiprecision/cpp_int.hpp>
- #define lli long long
- #define pi 3.14159265358979323846
- #define MOD 1000000007
- #define unbuffer cin.clear(); cin.sync();
- #define foi(n) for(lli i=0;i<n;i++)
- #define foj(n) for(lli j=0;j<n;j++)
- #define test(T) lli T;cin>>T;while(T--)
- #define loop(i, a, b) for(int i = (a); i<= (b); i++)
- using namespace std;
- //using namespace boost::multiprecision;
- int main()
- {
- lli n,m,temp;
- cin>>n>>m;
- temp=n;
- if(n==0)
- {
- if(m==0)
- cout<<"1";
- else
- cout<<"0";
- }
- else
- {
- if(m==0)
- cout<<"1";
- else
- {
- while(--m)
- n*=temp;
- cout<<n;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement