Skip to content

Update action #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fixed checkstyle
  • Loading branch information
realDuYuanChao committed Nov 2, 2020
commit 2cebef5472e70f2b05d77fce9f276973b1c2a280
12 changes: 4 additions & 8 deletions .github/workflows/checkstyle.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: Code Formatter

on:
pull_request:
push:
branches:
- master
on: [push]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@master
- uses: actions/setup-python@v2
- name: Set up JDK 12
uses: actions/setup-java@v1
Expand All @@ -24,5 +20,5 @@ jobs:
git config --global user.name github-actions
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git commit -am "Formatted with Google Java Formatter"
git push --force origin HEAD:$GITHUB_REF
git commit -am "Formatted with Google Java Formatter" || true
git push --force origin HEAD:$GITHUB_REF || true
9 changes: 5 additions & 4 deletions Conversions/BinaryToDecimal.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ class BinaryToDecimal {
*
* @param args Command line arguments
*/
public static void main(String args[]) {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int binNum, binCopy, d, s = 0, power = 0;
System.out.print("Binary number: ");
System.out.print("Binary number: ");
binNum = sc.nextInt();
binCopy = binNum;
while (binCopy != 0) {
d = binCopy % 10;
while (binCopy != 0)
{
d = binCopy % 10;
s += d * (int) Math.pow(2, power++);
binCopy /= 10;
}
Expand Down