Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

THE LAST DIGIT

$
0
0

i have made a way to assign the last number but on uploading it on spoj it says wrong answer . can anyone can help to sort out this problem. my code is:

include<iostream>

include<cmath>

using namespace std; int main() { short int t; cin>>t; if(t<=30) {while(t-- ) {short int a; short int r=0; long long int b,c; cin>>a>>b; if(a==0 && b==0) { break; } else if(b==0) { cout<<"1\n"; } else if(a==0) { cout<<"0\n"; } else { r=b%4; if(r==0) { c=a%2; if(c==0) cout<<"6\n"; else if(c==1) cout<<"1\n"; } else { c=pow(a,r); c=c%10; cout<<c<<endl; } } } } return 0; }


Viewing all articles
Browse latest Browse all 39796

Trending Articles


Tabia za mabinti wa kipogoro,


Grimsby rapist jailed after attacking same woman twice on same day


HOt And Séxy Photos of Mampi


Neem Baba Extra Questions Answer Class 6 English Poorvi


Lloyds Auctioneers & Valuers Pty Limited v Benson [2025] FCA 324


Download: Chester – Baleken Basabaile (Prod. By Silva)


DT 31015


Turing Cup 2019 Qualifiers (TCQF19) - EDITORIAL


Bingie


Problem with "Removable Bootloader"



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>